chore 优化代码
This commit is contained in:
@ -6,5 +6,4 @@ namespace KonSoft.TenantManagement.EntityFrameworkCore.Applications;
|
||||
[Collection(TenantManagementTestConsts.CollectionDefinitionName)]
|
||||
public class EfCoreSampleAppServiceTests : SampleAppServiceTests<TenantManagementEntityFrameworkCoreTestModule>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -6,5 +6,4 @@ namespace KonSoft.TenantManagement.EntityFrameworkCore.Domains;
|
||||
[Collection(TenantManagementTestConsts.CollectionDefinitionName)]
|
||||
public class EfCoreSampleDomainTests : SampleDomainTests<TenantManagementEntityFrameworkCoreTestModule>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -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 : TenantManagementEntityFrameworkCoreTestBase
|
||||
*/
|
||||
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();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
namespace KonSoft.TenantManagement.EntityFrameworkCore;
|
||||
|
||||
[CollectionDefinition(TenantManagementTestConsts.CollectionDefinitionName)]
|
||||
public class TenantManagementEntityFrameworkCoreCollection : ICollectionFixture<TenantManagementEntityFrameworkCoreFixture>
|
||||
public class
|
||||
TenantManagementEntityFrameworkCoreCollection : ICollectionFixture<TenantManagementEntityFrameworkCoreFixture>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
using KonSoft.TenantManagement.EntityFrameworkCore;
|
||||
using Xunit;
|
||||
using Xunit;
|
||||
|
||||
namespace KonSoft.TenantManagement.EntityFrameworkCore;
|
||||
|
||||
public class TenantManagementEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture<TenantManagementEntityFrameworkCoreFixture>
|
||||
public class
|
||||
TenantManagementEntityFrameworkCoreCollectionFixtureBase : ICollectionFixture<
|
||||
TenantManagementEntityFrameworkCoreFixture>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,5 @@ public class TenantManagementEntityFrameworkCoreFixture : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,7 @@
|
||||
using Volo.Abp;
|
||||
namespace KonSoft.TenantManagement.EntityFrameworkCore;
|
||||
|
||||
namespace KonSoft.TenantManagement.EntityFrameworkCore;
|
||||
|
||||
public abstract class TenantManagementEntityFrameworkCoreTestBase : TenantManagementTestBase<TenantManagementEntityFrameworkCoreTestModule>
|
||||
public abstract class
|
||||
TenantManagementEntityFrameworkCoreTestBase : TenantManagementTestBase<
|
||||
TenantManagementEntityFrameworkCoreTestModule>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,7 @@ namespace KonSoft.TenantManagement.EntityFrameworkCore;
|
||||
typeof(TenantManagementApplicationTestModule),
|
||||
typeof(TenantManagementEntityFrameworkCoreModule),
|
||||
typeof(AbpEntityFrameworkCoreSqliteModule)
|
||||
)]
|
||||
)]
|
||||
public class TenantManagementEntityFrameworkCoreTestModule : AbpModule
|
||||
{
|
||||
private SqliteConnection? _sqliteConnection;
|
||||
@ -51,10 +51,7 @@ public class TenantManagementEntityFrameworkCoreTestModule : 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 TenantManagementEntityFrameworkCoreTestModule : AbpModule
|
||||
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user