예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
            }
        }