Skip to content

Commit 154e954

Browse files
tests: this commit injects the payment gateway mock
1 parent ebd53ad commit 154e954

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Boundaries/Comanda.Payments/Tests/Fixtures/WebApplicationFixture.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ public async ValueTask InitializeAsync()
5353
if (descriptor is not null)
5454
services.Remove(descriptor);
5555

56+
descriptor = services.SingleOrDefault(descriptor => descriptor.ServiceType == typeof(IPaymentGateway));
57+
if (descriptor is not null)
58+
services.Remove(descriptor);
59+
5660
services.AddSingleton(_ => _databaseFixture.Client);
5761
services.AddSingleton(_ => _databaseFixture.Database);
62+
services.AddSingleton<IPaymentGateway, PaymentGatewayMock>();
5863
});
5964
});
6065

0 commit comments

Comments
 (0)