mirror of https://github.com/abpframework/abp
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.
33 lines
1021 B
33 lines
1021 B
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Shouldly;
|
|
using Volo.Abp.Modularity;
|
|
using Volo.Abp.Uow;
|
|
using Xunit;
|
|
|
|
namespace Volo.Abp.TenantManagement
|
|
{
|
|
public abstract class LazyLoad_Tests<TStartupModule> : TenantManagementTestBase<TStartupModule>
|
|
where TStartupModule : IAbpModule
|
|
{
|
|
public ITenantRepository TenantRepository { get; }
|
|
|
|
protected LazyLoad_Tests()
|
|
{
|
|
TenantRepository = GetRequiredService<ITenantRepository>();
|
|
}
|
|
|
|
[Fact]
|
|
public async Task Should_Lazy_Load_Tenant_Collections()
|
|
{
|
|
using (var uow = GetRequiredService<IUnitOfWorkManager>().Begin())
|
|
{
|
|
var role = await TenantRepository.FindByNameAsync("acme", includeDetails: false).ConfigureAwait(false);
|
|
role.ConnectionStrings.ShouldNotBeNull();
|
|
role.ConnectionStrings.Any().ShouldBeTrue();
|
|
|
|
await uow.CompleteAsync().ConfigureAwait(false);
|
|
}
|
|
}
|
|
}
|
|
} |