public async void All() { var mock = new ServiceMockFacade <IChannelRepository>(); var records = new List <Channel>(); records.Add(new Channel()); mock.RepositoryMock.Setup(x => x.All(It.IsAny <int>(), It.IsAny <int>())).Returns(Task.FromResult(records)); var service = new ChannelService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.ChannelModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLChannelMapperMock, mock.DALMapperMockFactory.DALChannelMapperMock); List <ApiChannelResponseModel> response = await service.All(); response.Should().HaveCount(1); mock.RepositoryMock.Verify(x => x.All(It.IsAny <int>(), It.IsAny <int>())); }