File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 55using Bit . Core . AdminConsole . Entities ;
66using Bit . Core . AdminConsole . Enums . Provider ;
77using Bit . Core . Billing . Enums ;
8+ using Bit . Core . Billing . Pricing ;
89using Bit . Core . Enums ;
910using Bit . Core . Repositories ;
11+ using Bit . Core . Test . Billing . Mocks ;
12+ using NSubstitute ;
1013using Xunit ;
1114
1215namespace Bit . Api . IntegrationTest . AdminConsole . Controllers ;
@@ -25,6 +28,15 @@ public class OrganizationsControllerTests : IClassFixture<ApiApplicationFactory>
2528 public OrganizationsControllerTests ( ApiApplicationFactory apiFactory )
2629 {
2730 _factory = apiFactory ;
31+ _factory . SubstituteService < IPricingClient > ( pricingClient =>
32+ {
33+ pricingClient
34+ . GetPlan ( Arg . Any < PlanType > ( ) )
35+ . Returns ( x => MockPlans . Get ( x . Arg < PlanType > ( ) ) ) ;
36+ pricingClient
37+ . GetPlanOrThrow ( Arg . Any < PlanType > ( ) )
38+ . Returns ( x => MockPlans . Get ( x . Arg < PlanType > ( ) ) ) ;
39+ } ) ;
2840 _client = _factory . CreateClient ( ) ;
2941 _loginHelper = new LoginHelper ( _factory , _client ) ;
3042 }
Original file line number Diff line number Diff line change 1919 <ItemGroup >
2020 <ProjectReference Include =" ..\..\src\Api\Api.csproj" />
2121 <ProjectReference Include =" ..\..\util\Seeder\Seeder.csproj" />
22+ <ProjectReference Include =" ..\Core.Test\Core.Test.csproj" />
2223 <ProjectReference Include =" ..\IntegrationTestCommon\IntegrationTestCommon.csproj" />
2324
2425 <Content Include =" ..\..\src\Api\appsettings.*.json" >
You can’t perform that action at this time.
0 commit comments