public async void All() { var mock = new ServiceMockFacade <IInvitationRepository>(); var records = new List <Invitation>(); records.Add(new Invitation()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records)); var service = new InvitationService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.InvitationModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLInvitationMapperMock, mock.DALMapperMockFactory.DALInvitationMapperMock); List <ApiInvitationResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>())); }