Skip to content

Commit 4655106

Browse files
committed
feat: configure RabbitMQ and mock IMessageBus in test factory
1 parent 981f0c6 commit 4655106

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

REST API/TestHelpers/Fixture/WebApplicationTestFactory.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Moq;
1515
using StackExchange.Redis;
1616
using StockManager.Core.Domain.Interfaces.Repositories.BaseRepository;
17+
using StockManager.Core.Domain.Interfaces.Services;
1718
using StockManager.Infrastructure.Persistence.Data;
1819
using TestHelpers.TestHelpers.Auth;
1920

@@ -98,6 +99,9 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
9899
})
99100
.AddScheme<AuthenticationSchemeOptions, TestAuthHandler>(
100101
"Test", options => { });
101-
});
102+
103+
var messageBusMock = new Mock<IMessageBus>();
104+
services.AddSingleton<IMessageBus>(messageBusMock.Object);
105+
});
102106
}
103107
}

0 commit comments

Comments
 (0)