2023-01-26 17:51:26 +01:00
|
|
|
|
using System.Security.Claims;
|
|
|
|
|
using System.Text.Json;
|
|
|
|
|
using AutoFixture;
|
2023-03-02 19:23:38 +01:00
|
|
|
|
using Bit.Api.Vault.Controllers;
|
|
|
|
|
using Bit.Api.Vault.Models.Response;
|
2023-11-22 22:07:37 +01:00
|
|
|
|
using Bit.Core.AdminConsole.Entities;
|
2023-10-26 19:38:29 +02:00
|
|
|
|
using Bit.Core.AdminConsole.Enums.Provider;
|
|
|
|
|
using Bit.Core.AdminConsole.Models.Data.Provider;
|
|
|
|
|
using Bit.Core.AdminConsole.Repositories;
|
2023-01-26 17:51:26 +01:00
|
|
|
|
using Bit.Core.Entities;
|
|
|
|
|
using Bit.Core.Enums;
|
|
|
|
|
using Bit.Core.Exceptions;
|
|
|
|
|
using Bit.Core.Models.Data;
|
|
|
|
|
using Bit.Core.Models.Data.Organizations.OrganizationUsers;
|
|
|
|
|
using Bit.Core.Repositories;
|
|
|
|
|
using Bit.Core.Services;
|
2023-04-18 14:05:17 +02:00
|
|
|
|
using Bit.Core.Tools.Entities;
|
|
|
|
|
using Bit.Core.Tools.Repositories;
|
2023-01-26 17:51:26 +01:00
|
|
|
|
using Bit.Core.Utilities;
|
2023-03-02 19:23:38 +01:00
|
|
|
|
using Bit.Core.Vault.Entities;
|
|
|
|
|
using Bit.Core.Vault.Models.Data;
|
|
|
|
|
using Bit.Core.Vault.Repositories;
|
2023-01-26 17:51:26 +01:00
|
|
|
|
using Bit.Test.Common.AutoFixture;
|
|
|
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
|
|
|
|
using NSubstitute;
|
|
|
|
|
using NSubstitute.ReturnsExtensions;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Bit.Api.Test.Controllers;
|
|
|
|
|
|
|
|
|
|
[ControllerCustomize(typeof(SyncController))]
|
|
|
|
|
[SutProviderCustomize]
|
|
|
|
|
public class SyncControllerTests
|
|
|
|
|
{
|
|
|
|
|
[Theory]
|
|
|
|
|
[BitAutoData]
|
|
|
|
|
public async Task Get_ThrowBadRequest_WhenUserNotFound(SutProvider<SyncController> sutProvider)
|
|
|
|
|
{
|
|
|
|
|
sutProvider.GetDependency<IUserService>().GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).ReturnsNull();
|
|
|
|
|
|
|
|
|
|
async Task<SyncResponseModel> GetAction()
|
|
|
|
|
{
|
|
|
|
|
return await sutProvider.Sut.Get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await Assert.ThrowsAsync<BadRequestException>((Func<Task<SyncResponseModel>>)GetAction);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
|
[BitAutoData]
|
|
|
|
|
public async Task Get_Success_AtLeastOneEnabledOrg(User user,
|
|
|
|
|
List<List<string>> userEquivalentDomains,
|
|
|
|
|
List<GlobalEquivalentDomainsType> userExcludedGlobalEquivalentDomains,
|
|
|
|
|
ICollection<OrganizationUserOrganizationDetails> organizationUserDetails,
|
|
|
|
|
ICollection<ProviderUserProviderDetails> providerUserDetails,
|
|
|
|
|
IEnumerable<ProviderUserOrganizationDetails> providerUserOrganizationDetails,
|
|
|
|
|
ICollection<Folder> folders,
|
|
|
|
|
ICollection<CipherDetails> ciphers,
|
|
|
|
|
ICollection<Send> sends,
|
|
|
|
|
ICollection<Policy> policies,
|
|
|
|
|
ICollection<CollectionDetails> collections,
|
|
|
|
|
SutProvider<SyncController> sutProvider)
|
|
|
|
|
{
|
|
|
|
|
// Get dependencies
|
|
|
|
|
var userService = sutProvider.GetDependency<IUserService>();
|
|
|
|
|
var organizationUserRepository = sutProvider.GetDependency<IOrganizationUserRepository>();
|
|
|
|
|
var providerUserRepository = sutProvider.GetDependency<IProviderUserRepository>();
|
|
|
|
|
var folderRepository = sutProvider.GetDependency<IFolderRepository>();
|
|
|
|
|
var cipherRepository = sutProvider.GetDependency<ICipherRepository>();
|
|
|
|
|
var sendRepository = sutProvider.GetDependency<ISendRepository>();
|
|
|
|
|
var policyRepository = sutProvider.GetDependency<IPolicyRepository>();
|
|
|
|
|
var collectionRepository = sutProvider.GetDependency<ICollectionRepository>();
|
|
|
|
|
var collectionCipherRepository = sutProvider.GetDependency<ICollectionCipherRepository>();
|
|
|
|
|
|
|
|
|
|
// Adjust random data to match required formats / test intentions
|
|
|
|
|
user.EquivalentDomains = JsonSerializer.Serialize(userEquivalentDomains);
|
|
|
|
|
user.ExcludedGlobalEquivalentDomains = JsonSerializer.Serialize(userExcludedGlobalEquivalentDomains);
|
|
|
|
|
|
2023-10-17 16:56:35 +02:00
|
|
|
|
// At least 1 org needs to be enabled to fully test
|
2023-01-26 17:51:26 +01:00
|
|
|
|
if (!organizationUserDetails.Any(o => o.Enabled))
|
|
|
|
|
{
|
|
|
|
|
// We need at least 1 enabled org
|
|
|
|
|
if (organizationUserDetails.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
organizationUserDetails.First().Enabled = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// create an enabled org
|
|
|
|
|
var enabledOrg = new Fixture().Create<OrganizationUserOrganizationDetails>();
|
|
|
|
|
enabledOrg.Enabled = true;
|
|
|
|
|
organizationUserDetails.Add((enabledOrg));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Setup returns
|
|
|
|
|
userService.GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).ReturnsForAnyArgs(user);
|
|
|
|
|
|
|
|
|
|
organizationUserRepository
|
|
|
|
|
.GetManyDetailsByUserAsync(user.Id, OrganizationUserStatusType.Confirmed).Returns(organizationUserDetails);
|
|
|
|
|
|
|
|
|
|
providerUserRepository
|
|
|
|
|
.GetManyDetailsByUserAsync(user.Id, ProviderUserStatusType.Confirmed).Returns(providerUserDetails);
|
|
|
|
|
|
|
|
|
|
providerUserRepository
|
|
|
|
|
.GetManyOrganizationDetailsByUserAsync(user.Id, ProviderUserStatusType.Confirmed)
|
|
|
|
|
.Returns(providerUserOrganizationDetails);
|
|
|
|
|
|
|
|
|
|
folderRepository.GetManyByUserIdAsync(user.Id).Returns(folders);
|
2024-07-24 01:03:09 +02:00
|
|
|
|
cipherRepository.GetManyByUserIdAsync(user.Id).Returns(ciphers);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
|
|
|
|
|
sendRepository
|
|
|
|
|
.GetManyByUserIdAsync(user.Id).Returns(sends);
|
|
|
|
|
|
|
|
|
|
policyRepository.GetManyByUserIdAsync(user.Id).Returns(policies);
|
|
|
|
|
|
|
|
|
|
// Returns for methods only called if we have enabled orgs
|
2024-07-24 01:03:09 +02:00
|
|
|
|
collectionRepository.GetManyByUserIdAsync(user.Id).Returns(collections);
|
2024-07-03 04:06:36 +02:00
|
|
|
|
collectionCipherRepository.GetManyByUserIdAsync(user.Id).Returns(new List<CollectionCipher>());
|
2023-01-26 17:51:26 +01:00
|
|
|
|
// Back to standard test setup
|
|
|
|
|
userService.TwoFactorIsEnabledAsync(user).Returns(false);
|
|
|
|
|
userService.HasPremiumFromOrganization(user).Returns(false);
|
|
|
|
|
|
|
|
|
|
// Execute GET
|
|
|
|
|
var result = await sutProvider.Sut.Get();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Asserts
|
|
|
|
|
// Assert that methods are called
|
|
|
|
|
var hasEnabledOrgs = organizationUserDetails.Any(o => o.Enabled);
|
|
|
|
|
this.AssertMethodsCalledAsync(userService, organizationUserRepository, providerUserRepository, folderRepository,
|
|
|
|
|
cipherRepository, sendRepository, collectionRepository, collectionCipherRepository, hasEnabledOrgs);
|
|
|
|
|
|
|
|
|
|
Assert.IsType<SyncResponseModel>(result);
|
|
|
|
|
|
|
|
|
|
// Collections should not be empty when at least 1 org is enabled
|
|
|
|
|
Assert.NotEmpty(result.Collections);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
|
[BitAutoData]
|
|
|
|
|
public async Task Get_Success_AllDisabledOrgs(User user,
|
|
|
|
|
List<List<string>> userEquivalentDomains,
|
|
|
|
|
List<GlobalEquivalentDomainsType> userExcludedGlobalEquivalentDomains,
|
|
|
|
|
ICollection<OrganizationUserOrganizationDetails> organizationUserDetails,
|
|
|
|
|
ICollection<ProviderUserProviderDetails> providerUserDetails,
|
|
|
|
|
IEnumerable<ProviderUserOrganizationDetails> providerUserOrganizationDetails,
|
|
|
|
|
ICollection<Folder> folders,
|
|
|
|
|
ICollection<CipherDetails> ciphers,
|
|
|
|
|
ICollection<Send> sends,
|
|
|
|
|
ICollection<Policy> policies,
|
|
|
|
|
SutProvider<SyncController> sutProvider)
|
|
|
|
|
{
|
|
|
|
|
// Get dependencies
|
|
|
|
|
var userService = sutProvider.GetDependency<IUserService>();
|
|
|
|
|
var organizationUserRepository = sutProvider.GetDependency<IOrganizationUserRepository>();
|
|
|
|
|
var providerUserRepository = sutProvider.GetDependency<IProviderUserRepository>();
|
|
|
|
|
var folderRepository = sutProvider.GetDependency<IFolderRepository>();
|
|
|
|
|
var cipherRepository = sutProvider.GetDependency<ICipherRepository>();
|
|
|
|
|
var sendRepository = sutProvider.GetDependency<ISendRepository>();
|
|
|
|
|
var policyRepository = sutProvider.GetDependency<IPolicyRepository>();
|
|
|
|
|
var collectionRepository = sutProvider.GetDependency<ICollectionRepository>();
|
|
|
|
|
var collectionCipherRepository = sutProvider.GetDependency<ICollectionCipherRepository>();
|
|
|
|
|
|
|
|
|
|
// Adjust random data to match required formats / test intentions
|
|
|
|
|
user.EquivalentDomains = JsonSerializer.Serialize(userEquivalentDomains);
|
|
|
|
|
user.ExcludedGlobalEquivalentDomains = JsonSerializer.Serialize(userExcludedGlobalEquivalentDomains);
|
|
|
|
|
|
2023-10-17 16:56:35 +02:00
|
|
|
|
// All orgs disabled
|
2023-01-26 17:51:26 +01:00
|
|
|
|
if (organizationUserDetails.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
foreach (var orgUserDetails in organizationUserDetails)
|
|
|
|
|
{
|
|
|
|
|
orgUserDetails.Enabled = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var disabledOrg = new Fixture().Create<OrganizationUserOrganizationDetails>();
|
|
|
|
|
disabledOrg.Enabled = false;
|
|
|
|
|
organizationUserDetails.Add((disabledOrg));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Setup returns
|
|
|
|
|
userService.GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).ReturnsForAnyArgs(user);
|
|
|
|
|
|
|
|
|
|
organizationUserRepository
|
|
|
|
|
.GetManyDetailsByUserAsync(user.Id, OrganizationUserStatusType.Confirmed).Returns(organizationUserDetails);
|
|
|
|
|
|
|
|
|
|
providerUserRepository
|
|
|
|
|
.GetManyDetailsByUserAsync(user.Id, ProviderUserStatusType.Confirmed).Returns(providerUserDetails);
|
|
|
|
|
|
|
|
|
|
providerUserRepository
|
|
|
|
|
.GetManyOrganizationDetailsByUserAsync(user.Id, ProviderUserStatusType.Confirmed)
|
|
|
|
|
.Returns(providerUserOrganizationDetails);
|
|
|
|
|
|
|
|
|
|
folderRepository.GetManyByUserIdAsync(user.Id).Returns(folders);
|
2024-07-24 01:03:09 +02:00
|
|
|
|
cipherRepository.GetManyByUserIdAsync(user.Id).Returns(ciphers);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
|
|
|
|
|
sendRepository
|
|
|
|
|
.GetManyByUserIdAsync(user.Id).Returns(sends);
|
|
|
|
|
|
|
|
|
|
policyRepository.GetManyByUserIdAsync(user.Id).Returns(policies);
|
|
|
|
|
|
|
|
|
|
userService.TwoFactorIsEnabledAsync(user).Returns(false);
|
|
|
|
|
userService.HasPremiumFromOrganization(user).Returns(false);
|
|
|
|
|
|
|
|
|
|
// Execute GET
|
|
|
|
|
var result = await sutProvider.Sut.Get();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Asserts
|
|
|
|
|
// Assert that methods are called
|
|
|
|
|
|
|
|
|
|
var hasEnabledOrgs = organizationUserDetails.Any(o => o.Enabled);
|
|
|
|
|
this.AssertMethodsCalledAsync(userService, organizationUserRepository, providerUserRepository, folderRepository,
|
|
|
|
|
cipherRepository, sendRepository, collectionRepository, collectionCipherRepository, hasEnabledOrgs);
|
|
|
|
|
|
|
|
|
|
Assert.IsType<SyncResponseModel>(result);
|
|
|
|
|
|
2023-10-17 16:56:35 +02:00
|
|
|
|
// Collections should be empty when all standard orgs are disabled.
|
2023-01-26 17:51:26 +01:00
|
|
|
|
Assert.Empty(result.Collections);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Test where provider org has specific plan type and assert plan type comes out on SyncResponseModel class on ProfileResponseModel
|
|
|
|
|
[Theory]
|
|
|
|
|
[BitAutoData]
|
|
|
|
|
public async Task Get_ProviderPlanTypeProperlyPopulated(User user,
|
|
|
|
|
List<List<string>> userEquivalentDomains,
|
|
|
|
|
List<GlobalEquivalentDomainsType> userExcludedGlobalEquivalentDomains,
|
|
|
|
|
ICollection<OrganizationUserOrganizationDetails> organizationUserDetails,
|
|
|
|
|
ICollection<ProviderUserProviderDetails> providerUserDetails,
|
|
|
|
|
IEnumerable<ProviderUserOrganizationDetails> providerUserOrganizationDetails,
|
|
|
|
|
ICollection<Folder> folders,
|
|
|
|
|
ICollection<CipherDetails> ciphers,
|
|
|
|
|
ICollection<Send> sends,
|
|
|
|
|
ICollection<Policy> policies,
|
|
|
|
|
ICollection<CollectionDetails> collections,
|
|
|
|
|
SutProvider<SyncController> sutProvider)
|
|
|
|
|
{
|
|
|
|
|
// Get dependencies
|
|
|
|
|
var userService = sutProvider.GetDependency<IUserService>();
|
|
|
|
|
var organizationUserRepository = sutProvider.GetDependency<IOrganizationUserRepository>();
|
|
|
|
|
var providerUserRepository = sutProvider.GetDependency<IProviderUserRepository>();
|
|
|
|
|
var folderRepository = sutProvider.GetDependency<IFolderRepository>();
|
|
|
|
|
var cipherRepository = sutProvider.GetDependency<ICipherRepository>();
|
|
|
|
|
var sendRepository = sutProvider.GetDependency<ISendRepository>();
|
|
|
|
|
var policyRepository = sutProvider.GetDependency<IPolicyRepository>();
|
|
|
|
|
var collectionRepository = sutProvider.GetDependency<ICollectionRepository>();
|
|
|
|
|
var collectionCipherRepository = sutProvider.GetDependency<ICollectionCipherRepository>();
|
|
|
|
|
|
|
|
|
|
// Adjust random data to match required formats / test intentions
|
|
|
|
|
user.EquivalentDomains = JsonSerializer.Serialize(userEquivalentDomains);
|
|
|
|
|
user.ExcludedGlobalEquivalentDomains = JsonSerializer.Serialize(userExcludedGlobalEquivalentDomains);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Setup returns
|
|
|
|
|
userService.GetUserByPrincipalAsync(Arg.Any<ClaimsPrincipal>()).ReturnsForAnyArgs(user);
|
|
|
|
|
|
|
|
|
|
organizationUserRepository
|
|
|
|
|
.GetManyDetailsByUserAsync(user.Id, OrganizationUserStatusType.Confirmed).Returns(organizationUserDetails);
|
|
|
|
|
|
|
|
|
|
providerUserRepository
|
|
|
|
|
.GetManyDetailsByUserAsync(user.Id, ProviderUserStatusType.Confirmed).Returns(providerUserDetails);
|
|
|
|
|
|
|
|
|
|
providerUserRepository
|
|
|
|
|
.GetManyOrganizationDetailsByUserAsync(user.Id, ProviderUserStatusType.Confirmed)
|
|
|
|
|
.Returns(providerUserOrganizationDetails);
|
|
|
|
|
|
|
|
|
|
folderRepository.GetManyByUserIdAsync(user.Id).Returns(folders);
|
2024-07-24 01:03:09 +02:00
|
|
|
|
cipherRepository.GetManyByUserIdAsync(user.Id).Returns(ciphers);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
|
|
|
|
|
sendRepository
|
|
|
|
|
.GetManyByUserIdAsync(user.Id).Returns(sends);
|
|
|
|
|
|
|
|
|
|
policyRepository.GetManyByUserIdAsync(user.Id).Returns(policies);
|
|
|
|
|
|
|
|
|
|
// Returns for methods only called if we have enabled orgs
|
2024-07-24 01:03:09 +02:00
|
|
|
|
collectionRepository.GetManyByUserIdAsync(user.Id).Returns(collections);
|
2024-07-03 04:06:36 +02:00
|
|
|
|
collectionCipherRepository.GetManyByUserIdAsync(user.Id).Returns(new List<CollectionCipher>());
|
2023-01-26 17:51:26 +01:00
|
|
|
|
// Back to standard test setup
|
|
|
|
|
userService.TwoFactorIsEnabledAsync(user).Returns(false);
|
|
|
|
|
userService.HasPremiumFromOrganization(user).Returns(false);
|
|
|
|
|
|
|
|
|
|
// Execute GET
|
|
|
|
|
var result = await sutProvider.Sut.Get();
|
|
|
|
|
|
|
|
|
|
// Asserts
|
|
|
|
|
// Assert that methods are called
|
|
|
|
|
|
|
|
|
|
var hasEnabledOrgs = organizationUserDetails.Any(o => o.Enabled);
|
|
|
|
|
this.AssertMethodsCalledAsync(userService, organizationUserRepository, providerUserRepository, folderRepository,
|
|
|
|
|
cipherRepository, sendRepository, collectionRepository, collectionCipherRepository, hasEnabledOrgs);
|
|
|
|
|
|
|
|
|
|
Assert.IsType<SyncResponseModel>(result);
|
|
|
|
|
|
|
|
|
|
// Look up ProviderOrg output and compare to ProviderOrg method inputs to ensure
|
2023-10-17 16:56:35 +02:00
|
|
|
|
// product type is set correctly.
|
2023-01-26 17:51:26 +01:00
|
|
|
|
foreach (var profProviderOrg in result.Profile.ProviderOrganizations)
|
|
|
|
|
{
|
|
|
|
|
var matchedProviderUserOrgDetails =
|
2023-07-14 17:18:26 +02:00
|
|
|
|
providerUserOrganizationDetails.FirstOrDefault(p => p.OrganizationId == profProviderOrg.Id);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
|
|
|
|
|
if (matchedProviderUserOrgDetails != null)
|
|
|
|
|
{
|
2024-06-14 21:34:47 +02:00
|
|
|
|
var providerOrgProductType = StaticStore.GetPlan(matchedProviderUserOrgDetails.PlanType).ProductTier;
|
|
|
|
|
Assert.Equal(providerOrgProductType, profProviderOrg.ProductTierType);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2024-02-22 17:59:08 +01:00
|
|
|
|
private async Task AssertMethodsCalledAsync(IUserService userService,
|
2023-01-26 17:51:26 +01:00
|
|
|
|
IOrganizationUserRepository organizationUserRepository,
|
|
|
|
|
IProviderUserRepository providerUserRepository, IFolderRepository folderRepository,
|
|
|
|
|
ICipherRepository cipherRepository, ISendRepository sendRepository,
|
|
|
|
|
ICollectionRepository collectionRepository,
|
|
|
|
|
ICollectionCipherRepository collectionCipherRepository,
|
|
|
|
|
bool hasEnabledOrgs)
|
|
|
|
|
{
|
|
|
|
|
await userService.ReceivedWithAnyArgs(1).GetUserByPrincipalAsync(default);
|
|
|
|
|
await organizationUserRepository.ReceivedWithAnyArgs(1)
|
|
|
|
|
.GetManyDetailsByUserAsync(default);
|
|
|
|
|
await providerUserRepository.ReceivedWithAnyArgs(1)
|
|
|
|
|
.GetManyDetailsByUserAsync(default);
|
|
|
|
|
await providerUserRepository.ReceivedWithAnyArgs(1)
|
|
|
|
|
.GetManyOrganizationDetailsByUserAsync(default);
|
|
|
|
|
|
|
|
|
|
await folderRepository.ReceivedWithAnyArgs(1)
|
|
|
|
|
.GetManyByUserIdAsync(default);
|
|
|
|
|
|
|
|
|
|
await cipherRepository.ReceivedWithAnyArgs(1)
|
2024-07-24 01:03:09 +02:00
|
|
|
|
.GetManyByUserIdAsync(default);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
|
|
|
|
|
await sendRepository.ReceivedWithAnyArgs(1)
|
|
|
|
|
.GetManyByUserIdAsync(default);
|
|
|
|
|
|
2023-10-17 16:56:35 +02:00
|
|
|
|
// These two are only called when at least 1 enabled org.
|
2023-01-26 17:51:26 +01:00
|
|
|
|
if (hasEnabledOrgs)
|
|
|
|
|
{
|
|
|
|
|
await collectionRepository.ReceivedWithAnyArgs(1)
|
2024-07-24 01:03:09 +02:00
|
|
|
|
.GetManyByUserIdAsync(default);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
await collectionCipherRepository.ReceivedWithAnyArgs(1)
|
2024-07-03 04:06:36 +02:00
|
|
|
|
.GetManyByUserIdAsync(default);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2023-10-17 16:56:35 +02:00
|
|
|
|
// all disabled orgs
|
2023-01-26 17:51:26 +01:00
|
|
|
|
await collectionRepository.ReceivedWithAnyArgs(0)
|
2024-07-24 01:03:09 +02:00
|
|
|
|
.GetManyByUserIdAsync(default);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
await collectionCipherRepository.ReceivedWithAnyArgs(0)
|
2024-07-03 04:06:36 +02:00
|
|
|
|
.GetManyByUserIdAsync(default);
|
2023-01-26 17:51:26 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await userService.ReceivedWithAnyArgs(1)
|
|
|
|
|
.TwoFactorIsEnabledAsync(default);
|
|
|
|
|
await userService.ReceivedWithAnyArgs(1)
|
|
|
|
|
.HasPremiumFromOrganization(default);
|
|
|
|
|
}
|
|
|
|
|
}
|