Browse Source

Merge branch 'main' into uptodotnet6.0

ipaddr
Enis Necipoglu 5 years ago
committed by GitHub
parent
commit
6d37802b7d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. BIN
      docs/roadmap/Phase_1.png
  2. 33
      services/catalog/test/EShopOnAbp.CatalogService.Application.Tests/Samples/SampleAppServiceTests.cs
  3. 45
      services/catalog/test/EShopOnAbp.CatalogService.Domain.Tests/Samples/SampleDomainTests.cs
  4. 44
      services/catalog/test/EShopOnAbp.CatalogService.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs
  5. 14
      services/catalog/test/EShopOnAbp.CatalogService.TestBase/CatalogServiceTestBaseModule.cs
  6. 1
      services/catalog/test/EShopOnAbp.CatalogService.TestBase/EShopOnAbp.CatalogService.TestBase.csproj
  7. 1
      services/payment/src/EShopOnAbp.PaymentService.Application/EShopOnAbp.PaymentService.Application.csproj

BIN
docs/roadmap/Phase_1.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 KiB

After

Width:  |  Height:  |  Size: 405 KiB

33
services/catalog/test/EShopOnAbp.CatalogService.Application.Tests/Samples/SampleAppServiceTests.cs

@ -1,33 +0,0 @@
using Shouldly;
using System.Threading.Tasks;
using Volo.Abp.Identity;
using Xunit;
namespace EShopOnAbp.CatalogService.Samples
{
/* This is just an example test class.
* Normally, you don't test code of the modules you are using
* (like IIdentityUserAppService here).
* Only test your own application services.
*/
public class SampleAppServiceTests : CatalogServiceApplicationTestBase
{
private readonly IIdentityUserAppService _userAppService;
public SampleAppServiceTests()
{
_userAppService = GetRequiredService<IIdentityUserAppService>();
}
[Fact]
public async Task Initial_Data_Should_Contain_Admin_User()
{
//Act
var result = await _userAppService.GetListAsync(new GetIdentityUsersInput());
//Assert
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(u => u.UserName == "admin");
}
}
}

45
services/catalog/test/EShopOnAbp.CatalogService.Domain.Tests/Samples/SampleDomainTests.cs

@ -1,45 +0,0 @@
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Identity;
using Xunit;
namespace EShopOnAbp.CatalogService.Samples
{
/* This is just an example test class.
* Normally, you don't test code of the modules you are using
* (like IdentityUserManager here).
* Only test your own domain services.
*/
public class SampleDomainTests : CatalogServiceDomainTestBase
{
private readonly IIdentityUserRepository _identityUserRepository;
private readonly IdentityUserManager _identityUserManager;
public SampleDomainTests()
{
_identityUserRepository = GetRequiredService<IIdentityUserRepository>();
_identityUserManager = GetRequiredService<IdentityUserManager>();
}
[Fact]
public async Task Should_Set_Email_Of_A_User()
{
IdentityUser adminUser;
/* Need to manually start Unit Of Work because
* FirstOrDefaultAsync should be executed while db connection / context is available.
*/
await WithUnitOfWorkAsync(async () =>
{
adminUser = await _identityUserRepository
.FindByNormalizedUserNameAsync("ADMIN");
await _identityUserManager.SetEmailAsync(adminUser, "newemail@abp.io");
await _identityUserRepository.UpdateAsync(adminUser);
});
adminUser = await _identityUserRepository.FindByNormalizedUserNameAsync("ADMIN");
adminUser.Email.ShouldBe("newemail@abp.io");
}
}
}

44
services/catalog/test/EShopOnAbp.CatalogService.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepositoryTests.cs

@ -1,44 +0,0 @@
using Microsoft.EntityFrameworkCore;
using Shouldly;
using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Xunit;
namespace EShopOnAbp.CatalogService.EntityFrameworkCore.Samples
{
/* This is just an example test class.
* Normally, you don't test ABP framework code
* (like default AppUser repository IRepository<AppUser, Guid> here).
* Only test your custom repository methods.
*/
public class SampleRepositoryTests : CatalogServiceEntityFrameworkCoreTestBase
{
private readonly IRepository<IdentityUser, Guid> _appUserRepository;
public SampleRepositoryTests()
{
_appUserRepository = GetRequiredService<IRepository<IdentityUser, Guid>>();
}
[Fact]
public async Task Should_Query_AppUser()
{
/* Need to manually start Unit Of Work because
* FirstOrDefaultAsync should be executed while db connection / context is available.
*/
await WithUnitOfWorkAsync(async () =>
{
//Act
var adminUser = await (await _appUserRepository.GetQueryableAsync())
.Where(u => u.UserName == "admin")
.FirstOrDefaultAsync();
//Assert
adminUser.ShouldNotBeNull();
});
}
}
}

14
services/catalog/test/EShopOnAbp.CatalogService.TestBase/CatalogServiceTestBaseModule.cs

@ -4,7 +4,6 @@ using Volo.Abp.Authorization;
using Volo.Abp.Autofac;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.Data;
using Volo.Abp.IdentityServer;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
@ -18,19 +17,6 @@ namespace EShopOnAbp.CatalogService
)]
public class CatalogServiceTestBaseModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<AbpIdentityServerBuilderOptions>(options =>
{
options.AddDeveloperSigningCredential = false;
});
PreConfigure<IIdentityServerBuilder>(identityServerBuilder =>
{
identityServerBuilder.AddDeveloperSigningCredential(false, System.Guid.NewGuid().ToString());
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpBackgroundJobOptions>(options =>

1
services/catalog/test/EShopOnAbp.CatalogService.TestBase/EShopOnAbp.CatalogService.TestBase.csproj

@ -11,6 +11,7 @@
<PackageReference Include="Volo.Abp.TestBase" Version="5.0.0-rc.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="5.0.0-rc.1" />
<PackageReference Include="Volo.Abp.Authorization" Version="5.0.0-rc.1" />
<PackageReference Include="Volo.Abp.BackgroundJobs.Abstractions" Version="5.0.0-rc.1" />
<ProjectReference Include="..\..\src\EShopOnAbp.CatalogService.Domain\EShopOnAbp.CatalogService.Domain.csproj" />
</ItemGroup>

1
services/payment/src/EShopOnAbp.PaymentService.Application/EShopOnAbp.PaymentService.Application.csproj

@ -8,6 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PayPalCheckoutSdk" Version="1.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.0.0-rc.1" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="5.0.0-rc.1" />
<ProjectReference Include="..\EShopOnAbp.PaymentService.Application.Contracts\EShopOnAbp.PaymentService.Application.Contracts.csproj" />

Loading…
Cancel
Save