public async void ByNameProjectId_Not_Exists() { var mock = new ServiceMockFacade <IChannelRepository>(); mock.RepositoryMock.Setup(x => x.ByNameProjectId(It.IsAny <string>(), It.IsAny <string>())).Returns(Task.FromResult <Channel>(null)); var service = new ChannelService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.ChannelModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLChannelMapperMock, mock.DALMapperMockFactory.DALChannelMapperMock); ApiChannelResponseModel response = await service.ByNameProjectId(default(string), default(string)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.ByNameProjectId(It.IsAny <string>(), It.IsAny <string>())); }