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 : TenantManagementTestBase where TStartupModule : IAbpModule { public ITenantRepository TenantRepository { get; } protected LazyLoad_Tests() { TenantRepository = GetRequiredService(); } [Fact] public async Task Should_Lazy_Load_Tenant_Collections() { using (var uow = GetRequiredService().Begin()) { var role = await TenantRepository.FindByNameAsync("acme", includeDetails: false).ConfigureAwait(false); role.ConnectionStrings.ShouldNotBeNull(); role.ConnectionStrings.Any().ShouldBeTrue(); await uow.CompleteAsync().ConfigureAwait(false); } } } }