public async void Get_null_record() { var mock = new ServiceMockFacade <INuGetPackageRepository>(); mock.RepositoryMock.Setup(x => x.Get(It.IsAny <string>())).Returns(Task.FromResult <NuGetPackage>(null)); var service = new NuGetPackageService(mock.LoggerMock.Object, mock.RepositoryMock.Object, mock.ModelValidatorMockFactory.NuGetPackageModelValidatorMock.Object, mock.BOLMapperMockFactory.BOLNuGetPackageMapperMock, mock.DALMapperMockFactory.DALNuGetPackageMapperMock); ApiNuGetPackageResponseModel response = await service.Get(default(string)); response.Should().BeNull(); mock.RepositoryMock.Verify(x => x.Get(It.IsAny <string>())); }
public async void TestGet() { ApiNuGetPackageResponseModel response = await this.Client.NuGetPackageGetAsync("A"); response.Should().NotBeNull(); }