chore 优化代码
This commit is contained in:
@ -17,9 +17,9 @@ public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor
|
||||
{
|
||||
return new ClaimsPrincipal(new ClaimsIdentity(new List<Claim>
|
||||
{
|
||||
new Claim(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"),
|
||||
new Claim(AbpClaimTypes.UserName, "admin"),
|
||||
new Claim(AbpClaimTypes.Email, "admin@abp.io")
|
||||
new(AbpClaimTypes.UserId, "2e701e62-0953-4dd3-910b-dc6cc93ccb0d"),
|
||||
new(AbpClaimTypes.UserName, "admin"),
|
||||
new(AbpClaimTypes.Email, "admin@abp.io")
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,8 +3,8 @@ using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.Modularity;
|
||||
using Volo.Abp.Uow;
|
||||
using Volo.Abp.Testing;
|
||||
using Volo.Abp.Uow;
|
||||
|
||||
namespace KonSoft.TenantManagement;
|
||||
|
||||
@ -43,7 +43,8 @@ public abstract class TenantManagementTestBase<TStartupModule> : AbpIntegratedTe
|
||||
return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func);
|
||||
}
|
||||
|
||||
protected virtual async Task<TResult> WithUnitOfWorkAsync<TResult>(AbpUnitOfWorkOptions options, Func<Task<TResult>> func)
|
||||
protected virtual async Task<TResult> WithUnitOfWorkAsync<TResult>(AbpUnitOfWorkOptions options,
|
||||
Func<Task<TResult>> func)
|
||||
{
|
||||
using (var scope = ServiceProvider.CreateScope())
|
||||
{
|
||||
@ -57,4 +58,4 @@ public abstract class TenantManagementTestBase<TStartupModule> : AbpIntegratedTe
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -14,15 +14,12 @@ namespace KonSoft.TenantManagement;
|
||||
typeof(AbpTestBaseModule),
|
||||
typeof(AbpAuthorizationModule),
|
||||
typeof(AbpBackgroundJobsAbstractionsModule)
|
||||
)]
|
||||
)]
|
||||
public class TenantManagementTestBaseModule : AbpModule
|
||||
{
|
||||
public override void ConfigureServices(ServiceConfigurationContext context)
|
||||
{
|
||||
Configure<AbpBackgroundJobOptions>(options =>
|
||||
{
|
||||
options.IsJobExecutionEnabled = false;
|
||||
});
|
||||
Configure<AbpBackgroundJobOptions>(options => { options.IsJobExecutionEnabled = false; });
|
||||
|
||||
context.Services.AddAlwaysAllowAuthorization();
|
||||
}
|
||||
@ -44,4 +41,4 @@ public class TenantManagementTestBaseModule : AbpModule
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,4 +3,4 @@
|
||||
public static class TenantManagementTestConsts
|
||||
{
|
||||
public const string CollectionDefinitionName = "TenantManagement collection";
|
||||
}
|
||||
}
|
||||
@ -12,4 +12,4 @@ public class TenantManagementTestDataSeedContributor : IDataSeedContributor, ITr
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user