mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 22:23:18 +08:00
53 lines
2.0 KiB
C#
53 lines
2.0 KiB
C#
|
|
using Bit.Core.Repositories;
|
|||
|
|
using Xunit;
|
|||
|
|
|
|||
|
|
namespace Bit.Infrastructure.IntegrationTest.AdminConsole.Repositories.CollectionRepository;
|
|||
|
|
|
|||
|
|
public class CreateDefaultCollectionsAsyncTests
|
|||
|
|
{
|
|||
|
|
[Theory, DatabaseData]
|
|||
|
|
public async Task CreateDefaultCollectionsAsync_CreatesDefaultCollections_Success(
|
|||
|
|
IOrganizationRepository organizationRepository,
|
|||
|
|
IUserRepository userRepository,
|
|||
|
|
IOrganizationUserRepository organizationUserRepository,
|
|||
|
|
ICollectionRepository collectionRepository)
|
|||
|
|
{
|
|||
|
|
await CreateDefaultCollectionsSharedTests.CreatesDefaultCollections_Success(
|
|||
|
|
collectionRepository.CreateDefaultCollectionsAsync,
|
|||
|
|
organizationRepository,
|
|||
|
|
userRepository,
|
|||
|
|
organizationUserRepository,
|
|||
|
|
collectionRepository);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Theory, DatabaseData]
|
|||
|
|
public async Task CreateDefaultCollectionsAsync_CreatesForNewUsersOnly_AndIgnoresExistingUsers(
|
|||
|
|
IOrganizationRepository organizationRepository,
|
|||
|
|
IUserRepository userRepository,
|
|||
|
|
IOrganizationUserRepository organizationUserRepository,
|
|||
|
|
ICollectionRepository collectionRepository)
|
|||
|
|
{
|
|||
|
|
await CreateDefaultCollectionsSharedTests.CreatesForNewUsersOnly_AndIgnoresExistingUsers(
|
|||
|
|
collectionRepository.CreateDefaultCollectionsAsync,
|
|||
|
|
organizationRepository,
|
|||
|
|
userRepository,
|
|||
|
|
organizationUserRepository,
|
|||
|
|
collectionRepository);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
[Theory, DatabaseData]
|
|||
|
|
public async Task CreateDefaultCollectionsAsync_IgnoresAllExistingUsers(
|
|||
|
|
IOrganizationRepository organizationRepository,
|
|||
|
|
IUserRepository userRepository,
|
|||
|
|
IOrganizationUserRepository organizationUserRepository,
|
|||
|
|
ICollectionRepository collectionRepository)
|
|||
|
|
{
|
|||
|
|
await CreateDefaultCollectionsSharedTests.IgnoresAllExistingUsers(
|
|||
|
|
collectionRepository.CreateDefaultCollectionsAsync,
|
|||
|
|
organizationRepository,
|
|||
|
|
userRepository,
|
|||
|
|
organizationUserRepository,
|
|||
|
|
collectionRepository);
|
|||
|
|
}
|
|||
|
|
}
|