public async Task ViewPackage(string packageId, int minCount) { NuGetController controller = new NuGetController(); var result = await controller.View(new ViewRequest { PackageID = packageId, Source = "nuget" }) as ViewResult; var model = result.Model as NuGetPackageViewResponse; Assert.True(model.Versions.Count >= minCount); }
public async Task SearchTerm(string searchTerm, int maxCount) { NuGetController controller = new NuGetController(); var result = await controller.Search(new SearchRequest { SearchTerm = searchTerm, Source = "nuget" }) as ViewResult; var model = result.Model as NuGetPackageSearchResponse; Assert.True(model.Results.Count <= maxCount); }
public async Task GetDependency(string packageId, string version, string framework, string fxversion, string profile, bool hasDependencies) { NuGetController controller = new NuGetController(); var result = await controller.GetDependencies(packageId, version, "nuget", framework, fxversion, profile, 2) as JsonResult; D3DependencyChild ob = result.Data as D3DependencyChild; if (hasDependencies) { Assert.NotNull(ob.children); } else { Assert.NotNull(ob); } }