unit testing

This commit is contained in:
2024-10-19 13:25:58 +01:00
parent 2b45e421dd
commit c615886a4c
22 changed files with 195 additions and 170 deletions

View File

@ -27,10 +27,10 @@ namespace isnd.Controllers
Source = packageManager.CatalogBaseUrl+ApiConfig.Index,
Query = model
};
List<PackageRegistration> registrations = new List<PackageRegistration>();
List<Catalog> registrations = new List<Catalog>();
foreach (var pk in pkgs.data.GroupBy(x => x.PackageId))
{
registrations.Add(new PackageRegistration(apiBase, pk.Key, pkgs.GetResults().Single(p=>p.Id == pk.Key).Versions));
registrations.Add(new Catalog(apiBase, pk.Key, pkgs.GetResults().Single(p=>p.Id == pk.Key).Versions));
}
return View(new RegistrationPageIndexQueryAndResult
@ -81,7 +81,7 @@ namespace isnd.Controllers
&& (pkgtype!=null && m.Type == pkgtype || m.Type != "Delete" ));
if (packageVersion == null) return NotFound();
if (!User.IsOwner(packageVersion)) return Unauthorized();
var pkg = await packageManager.GetPackageAsync(pkgid, version, pkgtype);
var pkg = await packageManager.GetPackageDetailsAsync(pkgid, version, pkgtype);
return View(pkg);
}