public async void ByCardNumber_Not_Exists() { var mock = new ServiceMockFacade <ICreditCardRepository>(); mock.RepositoryMock.Setup(x => x.ByCardNumber(It.IsAny <string>())).Returns(Task.FromResult <CreditCard>(null)); var service = new CreditCardService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.CreditCardModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLCreditCardMapperMock, mock.DALMapperMockFactory.DALCreditCardMapperMock, mock.BOLMapperMockFactory.BOLSalesOrderHeaderMapperMock, mock.DALMapperMockFactory.DALSalesOrderHeaderMapperMock); ApiCreditCardResponseModel response = await service.ByCardNumber(default(string)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.ByCardNumber(It.IsAny <string>())); }