How to instantiate Mediatr as part of a Unit Test?
You’re on the right lines with or a mockup – you need to mock the IMediator There’s a few mocking libraries out there: Moq FakeItEasy NSubstitute Moq is one of the most popular, so, using your test as an example: [Fact] public async void UpdateCustomerCommand_CustomerDataUpdatedOnDatabase() { //Arrange var mediator = new Mock<IMediator>(); UpdateCustomerCommand command = … Read more