public async void Get_null_record() { var mock = new ServiceMockFacade <ILinkTypesRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <int>())).Returns(Task.FromResult <LinkTypes>(null)); var service = new LinkTypesService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.LinkTypesModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLLinkTypesMapperMock, mock.DALMapperMockFactory.DALLinkTypesMapperMock); ApiLinkTypesResponseModel response = await service.Get(default(int)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <int>())); }