临河任务调度
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SampleAppServiceTests.cs 993B

12345678910111213141516171819202122232425262728293031323334
  1. using Shouldly;
  2. using System.Threading.Tasks;
  3. using Volo.Abp.Identity;
  4. using Volo.Abp.Modularity;
  5. using Xunit;
  6. namespace Acme.BookStore.Samples;
  7. /* This is just an example test class.
  8. * Normally, you don't test code of the modules you are using
  9. * (like IIdentityUserAppService here).
  10. * Only test your own application services.
  11. */
  12. public abstract class SampleAppServiceTests<TStartupModule> : BookStoreApplicationTestBase<TStartupModule>
  13. where TStartupModule : IAbpModule
  14. {
  15. private readonly IIdentityUserAppService _userAppService;
  16. protected SampleAppServiceTests()
  17. {
  18. _userAppService = GetRequiredService<IIdentityUserAppService>();
  19. }
  20. [Fact]
  21. public async Task Initial_Data_Should_Contain_Admin_User()
  22. {
  23. //Act
  24. var result = await _userAppService.GetListAsync(new GetIdentityUsersInput());
  25. //Assert
  26. result.TotalCount.ShouldBeGreaterThan(0);
  27. result.Items.ShouldContain(u => u.UserName == "admin");
  28. }
  29. }