public async void All() { var mock = new ServiceMockFacade <IReplyRepository>(); var records = new List <Reply>(); records.Add(new Reply()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records)); var service = new ReplyService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.ReplyModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLReplyMapperMock, mock.DALMapperMockFactory.DALReplyMapperMock); List <ApiReplyResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>())); }