mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 08:32:50 -05:00
Properly qualify namespace (#1328)
This commit is contained in:
@ -40,7 +40,7 @@ namespace Bit.Core.Test.Services
|
||||
|
||||
var id = Guid.NewGuid();
|
||||
|
||||
var collection = new Models.Table.Collection
|
||||
var collection = new Core.Models.Table.Collection
|
||||
{
|
||||
Id = id,
|
||||
};
|
||||
@ -55,7 +55,7 @@ namespace Bit.Core.Test.Services
|
||||
{
|
||||
// prepare the organization
|
||||
var testOrganizationId = Guid.NewGuid();
|
||||
var testOrganization = new Models.Table.Organization
|
||||
var testOrganization = new Core.Models.Table.Organization
|
||||
{
|
||||
Id = testOrganizationId,
|
||||
};
|
||||
@ -70,7 +70,7 @@ namespace Bit.Core.Test.Services
|
||||
_mailService);
|
||||
|
||||
// execute
|
||||
var testCollection = new Models.Table.Collection
|
||||
var testCollection = new Core.Models.Table.Collection
|
||||
{
|
||||
OrganizationId = testOrganizationId,
|
||||
};
|
||||
@ -85,7 +85,7 @@ namespace Bit.Core.Test.Services
|
||||
{
|
||||
// prepare the organization
|
||||
var testOrganizationId = Guid.NewGuid();
|
||||
var testOrganization = new Models.Table.Organization
|
||||
var testOrganization = new Core.Models.Table.Organization
|
||||
{
|
||||
Id = testOrganizationId,
|
||||
MaxCollections = 2,
|
||||
@ -102,7 +102,7 @@ namespace Bit.Core.Test.Services
|
||||
_userRepository,
|
||||
_mailService);
|
||||
|
||||
var testCollection = new Models.Table.Collection { OrganizationId = testOrganizationId };
|
||||
var testCollection = new Core.Models.Table.Collection { OrganizationId = testOrganizationId };
|
||||
|
||||
// verify & expect exception to be thrown
|
||||
var ex = await Assert.ThrowsAsync<BadRequestException>(() => collectionService.SaveAsync(testCollection));
|
||||
@ -116,12 +116,12 @@ namespace Bit.Core.Test.Services
|
||||
{
|
||||
// prepare the organization
|
||||
var testOrganizationId = Guid.NewGuid();
|
||||
var testOrganization = new Models.Table.Organization
|
||||
var testOrganization = new Core.Models.Table.Organization
|
||||
{
|
||||
Id = testOrganizationId,
|
||||
};
|
||||
var testUserId = Guid.NewGuid();
|
||||
var organizationUser = new Models.Table.OrganizationUser
|
||||
var organizationUser = new Core.Models.Table.OrganizationUser
|
||||
{
|
||||
Id = testUserId,
|
||||
OrganizationId = testOrganizationId,
|
||||
@ -137,7 +137,7 @@ namespace Bit.Core.Test.Services
|
||||
_userRepository,
|
||||
_mailService);
|
||||
|
||||
var testCollection = new Models.Table.Collection { OrganizationId = testOrganizationId };
|
||||
var testCollection = new Core.Models.Table.Collection { OrganizationId = testOrganizationId };
|
||||
await collectionService.DeleteUserAsync(testCollection, organizationUser.Id);
|
||||
|
||||
// verify
|
||||
@ -149,12 +149,12 @@ namespace Bit.Core.Test.Services
|
||||
{
|
||||
// prepare the organization
|
||||
var testOrganizationId = Guid.NewGuid();
|
||||
var testOrganization = new Models.Table.Organization
|
||||
var testOrganization = new Core.Models.Table.Organization
|
||||
{
|
||||
Id = testOrganizationId,
|
||||
};
|
||||
var testUserId = Guid.NewGuid();
|
||||
var nonOrganizationUser = new Models.Table.OrganizationUser
|
||||
var nonOrganizationUser = new Core.Models.Table.OrganizationUser
|
||||
{
|
||||
Id = testUserId,
|
||||
OrganizationId = Guid.NewGuid(),
|
||||
@ -170,7 +170,7 @@ namespace Bit.Core.Test.Services
|
||||
_userRepository,
|
||||
_mailService);
|
||||
|
||||
var testCollection = new Models.Table.Collection { OrganizationId = testOrganizationId };
|
||||
var testCollection = new Core.Models.Table.Collection { OrganizationId = testOrganizationId };
|
||||
|
||||
// verify
|
||||
// invalid user
|
||||
|
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Repositories;
|
||||
using Bit.Core.Services;
|
||||
using NSubstitute;
|
||||
@ -18,7 +19,7 @@ namespace Bit.Core.Test.Services
|
||||
|
||||
var id = Guid.NewGuid();
|
||||
var userId = Guid.NewGuid();
|
||||
var device = new Models.Table.Device
|
||||
var device = new Device
|
||||
{
|
||||
Id = id,
|
||||
Name = "test device",
|
||||
|
@ -73,10 +73,10 @@ namespace Bit.Core.Test.Services
|
||||
orgUserRepo.GetManyDetailsByOrganizationAsync(id).Returns(existingUsers);
|
||||
orgUserRepo.GetCountByOrganizationIdAsync(id).Returns(1);
|
||||
|
||||
var newUsers = new List<Models.Business.ImportedOrganizationUser>();
|
||||
newUsers.Add(new Models.Business.ImportedOrganizationUser { Email = "a@test.com", ExternalId = "a" });
|
||||
newUsers.Add(new Models.Business.ImportedOrganizationUser { Email = "b@test.com", ExternalId = "b" });
|
||||
newUsers.Add(new Models.Business.ImportedOrganizationUser { Email = "c@test.com", ExternalId = "c" });
|
||||
var newUsers = new List<ImportedOrganizationUser>();
|
||||
newUsers.Add(new ImportedOrganizationUser { Email = "a@test.com", ExternalId = "a" });
|
||||
newUsers.Add(new ImportedOrganizationUser { Email = "b@test.com", ExternalId = "b" });
|
||||
newUsers.Add(new ImportedOrganizationUser { Email = "c@test.com", ExternalId = "c" });
|
||||
await orgService.ImportAsync(id, userId, null, newUsers, null, false);
|
||||
|
||||
await orgUserRepo.DidNotReceive().UpsertAsync(Arg.Any<OrganizationUser>());
|
||||
@ -137,10 +137,10 @@ namespace Bit.Core.Test.Services
|
||||
orgUserRepo.GetCountByOrganizationIdAsync(id).Returns(1);
|
||||
orgUserRepo.GetByIdAsync(existingUserAId).Returns(new OrganizationUser { Id = existingUserAId });
|
||||
|
||||
var newUsers = new List<Models.Business.ImportedOrganizationUser>();
|
||||
newUsers.Add(new Models.Business.ImportedOrganizationUser { Email = "a@test.com", ExternalId = "a" });
|
||||
newUsers.Add(new Models.Business.ImportedOrganizationUser { Email = "b@test.com", ExternalId = "b" });
|
||||
newUsers.Add(new Models.Business.ImportedOrganizationUser { Email = "c@test.com", ExternalId = "c" });
|
||||
var newUsers = new List<ImportedOrganizationUser>();
|
||||
newUsers.Add(new ImportedOrganizationUser { Email = "a@test.com", ExternalId = "a" });
|
||||
newUsers.Add(new ImportedOrganizationUser { Email = "b@test.com", ExternalId = "b" });
|
||||
newUsers.Add(new ImportedOrganizationUser { Email = "c@test.com", ExternalId = "c" });
|
||||
await orgService.ImportAsync(id, userId, null, newUsers, null, false);
|
||||
|
||||
await orgUserRepo.Received(1).UpsertAsync(Arg.Any<OrganizationUser>());
|
||||
|
Reference in New Issue
Block a user