public async void All() { var mock = new ServiceMockFacade <IBankAccountRepository>(); var records = new List <BankAccount>(); records.Add(new BankAccount()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>())).Returns(Task.FromResult(records)); var service = new BankAccountService(mock.LoggerMock.Object, mock.MediatorMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.BankAccountModelValidatorMock.Object, mock.DALMapperMockFactory.DALBankAccountMapperMock); List <ApiBankAccountServerResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>(), It.IsAny <string>())); }