first commit
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
using Volo.Abp.Modularity;
|
||||
|
||||
namespace KonSoft.Dispatch;
|
||||
|
||||
public abstract class DispatchApplicationTestBase<TStartupModule> : DispatchTestBase<TStartupModule>
|
||||
where TStartupModule : IAbpModule
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
using Volo.Abp.Modularity;
|
||||
|
||||
namespace KonSoft.Dispatch;
|
||||
|
||||
[DependsOn(
|
||||
typeof(DispatchApplicationModule),
|
||||
typeof(DispatchDomainTestModule)
|
||||
)]
|
||||
public class DispatchApplicationTestModule : AbpModule
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\common.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>KonSoft.Dispatch</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\KonSoft.Dispatch.Application\KonSoft.Dispatch.Application.csproj" />
|
||||
<ProjectReference Include="..\KonSoft.Dispatch.Domain.Tests\KonSoft.Dispatch.Domain.Tests.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -0,0 +1,34 @@
|
||||
using Shouldly;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Identity;
|
||||
using Volo.Abp.Modularity;
|
||||
using Xunit;
|
||||
|
||||
namespace KonSoft.Dispatch.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 abstract class SampleAppServiceTests<TStartupModule> : DispatchApplicationTestBase<TStartupModule>
|
||||
where TStartupModule : IAbpModule
|
||||
{
|
||||
private readonly IIdentityUserAppService _userAppService;
|
||||
|
||||
protected 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");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user