public async Task GetCurrentPaymentMethod_ActivePaymentMethodDoesNotExist_NullReturned() { //Arrange var fakeMediator = Substitute.For <IMediator>(); fakeMediator .Send(Arg.Any <GetActivePaymentMethodForUserQuery>()) .Returns((PaymentMethod)null); var mapper = AutoMapperFactory.CreateValidMapper(); var controller = new PaymentController( fakeMediator, mapper); controller.FakeAuthentication("some-identity-name"); //Act var paymentMethodResponse = await controller.GetCurrentPaymentMethod(); //Assert var paymentMethod = paymentMethodResponse.ToObject <PaymentMethodResponse>(); Assert.IsNull(paymentMethod); }