diff --git a/test/Core.Test/AutoFixture/OrganizationFixtures.cs b/test/Core.Test/AutoFixture/OrganizationFixtures.cs index 0ca2960c7d..482de7e2d0 100644 --- a/test/Core.Test/AutoFixture/OrganizationFixtures.cs +++ b/test/Core.Test/AutoFixture/OrganizationFixtures.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text.Json; @@ -20,7 +20,7 @@ namespace Bit.Core.Test.AutoFixture.OrganizationFixtures { var organizationId = Guid.NewGuid(); - fixture.Customize(composer => composer + fixture.Customize(composer => composer .With(o => o.Id, organizationId) .With(o => o.UseGroups, UseGroups)); @@ -37,7 +37,7 @@ namespace Bit.Core.Test.AutoFixture.OrganizationFixtures var lowestActivePaidPlan = validUpgradePlans.First(); CheckedPlanType = CheckedPlanType.Equals(Enums.PlanType.Free) ? lowestActivePaidPlan : CheckedPlanType; validUpgradePlans.Remove(lowestActivePaidPlan); - fixture.Customize(composer => composer + fixture.Customize(composer => composer .With(o => o.PlanType, CheckedPlanType)); fixture.Customize(composer => composer .With(ou => ou.Plan, validUpgradePlans.First())); @@ -48,7 +48,7 @@ namespace Bit.Core.Test.AutoFixture.OrganizationFixtures { public void Customize(IFixture fixture) { - fixture.Customize(composer => composer + fixture.Customize(composer => composer .With(o => o.PlanType, PlanType.Free)); var plansToIgnore = new List { PlanType.Free, PlanType.Custom }; @@ -57,7 +57,7 @@ namespace Bit.Core.Test.AutoFixture.OrganizationFixtures fixture.Customize(composer => composer .With(ou => ou.Plan, selectedPlan.Type) .With(ou => ou.PremiumAccessAddon, selectedPlan.HasPremiumAccessOption)); - fixture.Customize(composer => composer + fixture.Customize(composer => composer .Without(o => o.GatewaySubscriptionId)); } } @@ -73,7 +73,7 @@ namespace Bit.Core.Test.AutoFixture.OrganizationFixtures { PropertyNamingPolicy = JsonNamingPolicy.CamelCase, }); - fixture.Customize(composer => composer + fixture.Customize(composer => composer .With(o => o.Id, organizationId) .With(o => o.Seats, (short)100)); fixture.Customize(composer => composer diff --git a/test/Core.Test/Services/CollectionServiceTests.cs b/test/Core.Test/Services/CollectionServiceTests.cs index e6ffd4cefa..bfecc70167 100644 --- a/test/Core.Test/Services/CollectionServiceTests.cs +++ b/test/Core.Test/Services/CollectionServiceTests.cs @@ -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(() => 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 diff --git a/test/Core.Test/Services/DeviceServiceTests.cs b/test/Core.Test/Services/DeviceServiceTests.cs index 00617d4c29..dd125759b2 100644 --- a/test/Core.Test/Services/DeviceServiceTests.cs +++ b/test/Core.Test/Services/DeviceServiceTests.cs @@ -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", diff --git a/test/Core.Test/Services/OrganizationServiceTests.cs b/test/Core.Test/Services/OrganizationServiceTests.cs index bc906a5021..b36021d35a 100644 --- a/test/Core.Test/Services/OrganizationServiceTests.cs +++ b/test/Core.Test/Services/OrganizationServiceTests.cs @@ -73,10 +73,10 @@ namespace Bit.Core.Test.Services orgUserRepo.GetManyDetailsByOrganizationAsync(id).Returns(existingUsers); orgUserRepo.GetCountByOrganizationIdAsync(id).Returns(1); - var newUsers = new List(); - 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(); + 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()); @@ -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(); - 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(); + 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());