From aefcbcbe7d095fbcca8f759e68f0069c45f34fa3 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Sat, 30 Oct 2021 13:47:21 -0400 Subject: [PATCH] Fix broken tests --- .../Services/ProviderServiceTests.cs | 4 +-- ...OrganizationSponsorshipsControllerTests.cs | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bitwarden_license/test/CmmCore.Test/Services/ProviderServiceTests.cs b/bitwarden_license/test/CmmCore.Test/Services/ProviderServiceTests.cs index a46d85443..b10c24926 100644 --- a/bitwarden_license/test/CmmCore.Test/Services/ProviderServiceTests.cs +++ b/bitwarden_license/test/CmmCore.Test/Services/ProviderServiceTests.cs @@ -13,8 +13,6 @@ using Bit.Core.Models.Table; using Bit.Core.Models.Table.Provider; using Bit.Core.Repositories; using Bit.Core.Services; -using Bit.Core.Test.AutoFixture; -using Bit.Core.Test.AutoFixture.Attributes; using Bit.Core.Utilities; using Microsoft.AspNetCore.DataProtection; using NSubstitute; @@ -22,6 +20,8 @@ using NSubstitute.ReturnsExtensions; using Xunit; using ProviderUser = Bit.Core.Models.Table.Provider.ProviderUser; using Bit.Core.Context; +using Bit.Test.Common.AutoFixture; +using Bit.Test.Common.AutoFixture.Attributes; namespace Bit.CommCore.Test.Services { diff --git a/test/Api.Test/Controllers/OrganizationSponsorshipsControllerTests.cs b/test/Api.Test/Controllers/OrganizationSponsorshipsControllerTests.cs index a2231d1ef..32e3e3f66 100644 --- a/test/Api.Test/Controllers/OrganizationSponsorshipsControllerTests.cs +++ b/test/Api.Test/Controllers/OrganizationSponsorshipsControllerTests.cs @@ -40,8 +40,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("Specified Organization cannot sponsor other organizations.", exception.Message); await sutProvider.GetDependency() - .OfferSponsorshipAsync(default, default, default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .OfferSponsorshipAsync(default, default, default); } public static IEnumerable NonConfirmedOrganizationUsersStatuses => @@ -69,8 +69,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("Only confirm users can sponsor other organizations.", exception.Message); await sutProvider.GetDependency() - .OfferSponsorshipAsync(default, default, default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .OfferSponsorshipAsync(default, default, default); } [Theory] @@ -92,8 +92,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("Can only create organization sponsorships for yourself.", exception.Message); await sutProvider.GetDependency() - .OfferSponsorshipAsync(default, default, default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .OfferSponsorshipAsync(default, default, default); } [Theory] @@ -117,8 +117,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("Can only sponsor one organization per Organization User.", exception.Message); await sutProvider.GetDependency() - .OfferSponsorshipAsync(default, default, default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .OfferSponsorshipAsync(default, default, default); } // TODO: Test redeem sponsorship @@ -137,8 +137,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("Can only revoke a sponsorship you granted.", exception.Message); await sutProvider.GetDependency() - .RemoveSponsorshipAsync(default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .RemoveSponsorshipAsync(default); } [Theory] @@ -161,8 +161,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("You are not currently sponsoring and organization.", exception.Message); await sutProvider.GetDependency() - .RemoveSponsorshipAsync(default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .RemoveSponsorshipAsync(default); } [Theory] @@ -177,8 +177,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("Only the owner of an organization can remove sponsorship.", exception.Message); await sutProvider.GetDependency() - .RemoveSponsorshipAsync(default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .RemoveSponsorshipAsync(default); } [Theory] @@ -199,8 +199,8 @@ namespace Bit.Api.Test.Controllers Assert.Contains("The requested organization is not currently being sponsored.", exception.Message); await sutProvider.GetDependency() - .RemoveSponsorshipAsync(default) - .DidNotReceiveWithAnyArgs(); + .DidNotReceiveWithAnyArgs() + .RemoveSponsorshipAsync(default); } } }