chore 优化代码
This commit is contained in:
		| @ -6,5 +6,4 @@ namespace KonSoft.Dispatch.EntityFrameworkCore.Applications; | ||||
| [Collection(DispatchTestConsts.CollectionDefinitionName)] | ||||
| public class EfCoreSampleAppServiceTests : SampleAppServiceTests<DispatchEntityFrameworkCoreTestModule> | ||||
| { | ||||
|  | ||||
| } | ||||
| } | ||||
| @ -5,5 +5,4 @@ namespace KonSoft.Dispatch.EntityFrameworkCore; | ||||
| [CollectionDefinition(DispatchTestConsts.CollectionDefinitionName)] | ||||
| public class DispatchEntityFrameworkCoreCollection : ICollectionFixture<DispatchEntityFrameworkCoreFixture> | ||||
| { | ||||
|  | ||||
| } | ||||
| } | ||||
| @ -1,9 +1,7 @@ | ||||
| using KonSoft.Dispatch.EntityFrameworkCore; | ||||
| using Xunit; | ||||
| using Xunit; | ||||
|  | ||||
| namespace KonSoft.Dispatch.EntityFrameworkCore; | ||||
|  | ||||
| public class DispatchEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture<DispatchEntityFrameworkCoreFixture> | ||||
| { | ||||
|  | ||||
| } | ||||
| } | ||||
| @ -6,6 +6,5 @@ public class DispatchEntityFrameworkCoreFixture : IDisposable | ||||
| { | ||||
|     public void Dispose() | ||||
|     { | ||||
|  | ||||
|     } | ||||
| } | ||||
| } | ||||
| @ -1,8 +1,5 @@ | ||||
| using Volo.Abp; | ||||
|  | ||||
| namespace KonSoft.Dispatch.EntityFrameworkCore; | ||||
| namespace KonSoft.Dispatch.EntityFrameworkCore; | ||||
|  | ||||
| public abstract class DispatchEntityFrameworkCoreTestBase : DispatchTestBase<DispatchEntityFrameworkCoreTestModule> | ||||
| { | ||||
|  | ||||
| } | ||||
| } | ||||
| @ -18,7 +18,7 @@ namespace KonSoft.Dispatch.EntityFrameworkCore; | ||||
|     typeof(DispatchApplicationTestModule), | ||||
|     typeof(DispatchEntityFrameworkCoreModule), | ||||
|     typeof(AbpEntityFrameworkCoreSqliteModule) | ||||
|     )] | ||||
| )] | ||||
| public class DispatchEntityFrameworkCoreTestModule : AbpModule | ||||
| { | ||||
|     private SqliteConnection? _sqliteConnection; | ||||
| @ -51,10 +51,7 @@ public class DispatchEntityFrameworkCoreTestModule : AbpModule | ||||
|  | ||||
|         services.Configure<AbpDbContextOptions>(options => | ||||
|         { | ||||
|             options.Configure(context => | ||||
|             { | ||||
|                 context.DbContextOptions.UseSqlite(_sqliteConnection); | ||||
|             }); | ||||
|             options.Configure(context => { context.DbContextOptions.UseSqlite(_sqliteConnection); }); | ||||
|         }); | ||||
|     } | ||||
|  | ||||
| @ -79,4 +76,4 @@ public class DispatchEntityFrameworkCoreTestModule : AbpModule | ||||
|  | ||||
|         return connection; | ||||
|     } | ||||
| } | ||||
| } | ||||
| @ -6,5 +6,4 @@ namespace KonSoft.Dispatch.EntityFrameworkCore.Domains; | ||||
| [Collection(DispatchTestConsts.CollectionDefinitionName)] | ||||
| public class EfCoreSampleDomainTests : SampleDomainTests<DispatchEntityFrameworkCoreTestModule> | ||||
| { | ||||
|  | ||||
| } | ||||
| } | ||||
| @ -1,8 +1,8 @@ | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Shouldly; | ||||
| using System; | ||||
| using System; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Shouldly; | ||||
| using Volo.Abp.Domain.Repositories; | ||||
| using Volo.Abp.Identity; | ||||
| using Xunit; | ||||
| @ -32,13 +32,13 @@ public class SampleRepositoryTests : DispatchEntityFrameworkCoreTestBase | ||||
|          */ | ||||
|         await WithUnitOfWorkAsync(async () => | ||||
|         { | ||||
|                 //Act | ||||
|                 var adminUser = await (await _appUserRepository.GetQueryableAsync()) | ||||
|             //Act | ||||
|             var adminUser = await (await _appUserRepository.GetQueryableAsync()) | ||||
|                 .Where(u => u.UserName == "admin") | ||||
|                 .FirstOrDefaultAsync(); | ||||
|  | ||||
|                 //Assert | ||||
|                 adminUser.ShouldNotBeNull(); | ||||
|             //Assert | ||||
|             adminUser.ShouldNotBeNull(); | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user