diff --git a/src/Services/Flight/tests/Flight/CreateFlightTest.cs b/src/Services/Flight/tests/Flight/CreateFlightTest.cs index c07f67d..a96fbe6 100644 --- a/src/Services/Flight/tests/Flight/CreateFlightTest.cs +++ b/src/Services/Flight/tests/Flight/CreateFlightTest.cs @@ -18,7 +18,7 @@ public class CreateFlightTest } [Fact] - public async Task should_create_new_flight_to_db() + public async Task should_create_new_flight_to_db_and_publish_message_to_broker() { // Arrange var fakeFlight = new FakeCreateFlightCommand().Generate(); @@ -33,6 +33,7 @@ public class CreateFlightTest // Assert flightResponse.Should().NotBeNull(); flightResponse?.FlightNumber.Should().Be(command.FlightNumber); - (await _fixture.IsConsumed()).Should().Be(true); + (await _fixture.IsFaultyPublished()).Should().BeFalse(); + (await _fixture.IsPublished()).Should().BeTrue(); } } diff --git a/src/Services/Flight/tests/TestFixture.cs b/src/Services/Flight/tests/TestFixture.cs index 3f2348c..ed48014 100644 --- a/src/Services/Flight/tests/TestFixture.cs +++ b/src/Services/Flight/tests/TestFixture.cs @@ -59,8 +59,6 @@ public class TestFixture : IAsyncLifetime services.ReplaceScoped(); services.AddMassTransitTestHarness(x => { - x.AddConsumer(); - x.UsingRabbitMq((context, cfg) => { var rabbitMqOptions = services.GetOptions("RabbitMq"); @@ -74,8 +72,6 @@ public class TestFixture : IAsyncLifetime cfg.ConfigureEndpoints(context); }); }); - - //FlightConsumer })); _harness = _factory.Services.GetTestHarness(); @@ -312,12 +308,6 @@ public class TestFixture : IAsyncLifetime foreach (var seeder in seeders) await seeder.SeedAllAsync(); } - // private async Task AddInMemoryHarnessAsync() - // { - // _harness = _factory.Services.GetRequiredService(); - // await _harness.Start(); - // } - private IHttpContextAccessor AddHttpContextAccessorMock(IServiceProvider serviceProvider) { var httpContextAccessorMock = Substitute.For();