diff --git a/GitVersion.yml b/GitVersion.yml deleted file mode 100644 index 122fa7e..0000000 --- a/GitVersion.yml +++ /dev/null @@ -1,5 +0,0 @@ -mode: Mainline -branches: {} -ignore: - sha: [] -merge-message-formats: {} diff --git a/contrib/testinstnuget/urls.adoc b/contrib/testinstnuget/urls.adoc index 5c81113..0eaabc5 100644 --- a/contrib/testinstnuget/urls.adoc +++ b/contrib/testinstnuget/urls.adoc @@ -1,4 +1,6 @@ = URL's - +https://isn.pschneider.fr/v3/registration/isn.abst/1.0.1.json + +https://api.nuget.org/v3/catalog0/data/2019.09.08.16.31.23/yavsc.abstract.1.0.6-rc06.json diff --git a/gitversion.json b/gitversion.json new file mode 100644 index 0000000..ca4522e --- /dev/null +++ b/gitversion.json @@ -0,0 +1,27 @@ +{ + "AssemblySemFileVer": "1.1.1.0", + "AssemblySemVer": "1.1.1.0", + "BranchName": "main", + "BuildMetaData": null, + "CommitDate": "2024-10-09", + "CommitsSinceVersionSource": 19, + "EscapedBranchName": "main", + "FullBuildMetaData": "Branch.main.Sha.2b45e421dda285b73bf7eb3387915030cd751b88", + "FullSemVer": "1.1.1-19", + "InformationalVersion": "1.1.1-19+Branch.main.Sha.2b45e421dda285b73bf7eb3387915030cd751b88", + "Major": 1, + "MajorMinorPatch": "1.1.1", + "Minor": 1, + "Patch": 1, + "PreReleaseLabel": "", + "PreReleaseLabelWithDash": "", + "PreReleaseNumber": 19, + "PreReleaseTag": "19", + "PreReleaseTagWithDash": "-19", + "SemVer": "1.1.1-19", + "Sha": "2b45e421dda285b73bf7eb3387915030cd751b88", + "ShortSha": "2b45e42", + "UncommittedChanges": 20, + "VersionSourceSha": "72839e8251297935a4ab138a99152733f07a23f2", + "WeightedPreReleaseNumber": 55019 +} \ No newline at end of file diff --git a/src/isn.abst/ApiConfig.cs b/src/isn.abst/ApiConfig.cs index e1edf18..5518cc3 100644 --- a/src/isn.abst/ApiConfig.cs +++ b/src/isn.abst/ApiConfig.cs @@ -16,6 +16,8 @@ namespace isnd.Entities public const string Content = "/content"; public const string Nuget = "/nuget"; + public const string PackageDetailUriTemplate = Package+"/{id}/{version}"; + [Obsolete("use the V3 search")] public const string V2Find = "/v2/FindPackagesById()"; // /FindPackagesById()??$filter=IsLatestVersion&$orderby=Version desc&$top=1&id='isn.abst' diff --git a/src/isn/isn.csproj b/src/isn/isn.csproj index 4fe7d07..0f0a9a8 100644 --- a/src/isn/isn.csproj +++ b/src/isn/isn.csproj @@ -15,11 +15,11 @@ 1.0.7+Branch.main.Sha.3695c1742965d93eba0ad851656cfaa3e44ba327 - + - - + + \ No newline at end of file diff --git a/src/isnd/Controllers/Packages/ApiIndex.cs b/src/isnd/Controllers/Packages/ApiIndex.cs index d80fb33..bb88187 100644 --- a/src/isnd/Controllers/Packages/ApiIndex.cs +++ b/src/isnd/Controllers/Packages/ApiIndex.cs @@ -33,7 +33,7 @@ namespace isnd.Controllers [HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.Index)] public IActionResult ApiIndex() { - return Ok(new ApiIndexViewModel(packageManager.CatalogBaseUrl){ Version = PackageManager.BASE_API_LEVEL, Resources = resources }); + return Ok(new ApiIndexViewModel(packageManager.CatalogBaseUrl + "/index.json"){ Version = PackageManager.BASE_API_LEVEL, Resources = resources }); } } diff --git a/src/isnd/Controllers/Packages/PackageController.Details.cs b/src/isnd/Controllers/Packages/PackageController.Details.cs new file mode 100644 index 0000000..2f2383a --- /dev/null +++ b/src/isnd/Controllers/Packages/PackageController.Details.cs @@ -0,0 +1,18 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using isnd.Entities; +using isn.abst; + +namespace isnd.Controllers +{ + public partial class PackagesController + { + [HttpGet("~" + Constants.ApiVersionPrefix + ApiConfig.PackageDetailUriTemplate)] + public async Task Details(string id, string version) + { + var result = await packageManager.GetPackageDetailsAsync(id, version); + if (result==null) return NotFound(); + return Ok(result); + } + } +} diff --git a/src/isnd/Controllers/Packages/PackagesController.Catalog.cs b/src/isnd/Controllers/Packages/PackagesController.Catalog.cs index 628996f..3284692 100644 --- a/src/isnd/Controllers/Packages/PackagesController.Catalog.cs +++ b/src/isnd/Controllers/Packages/PackagesController.Catalog.cs @@ -32,8 +32,8 @@ namespace isnd.Controllers return Ok(index); } - // return a Package - var leaf = await packageManager.GetCatalogEntryAsync(id, version, null); + // return Package details + var leaf = await packageManager.GetPackageDetailsAsync(id, version, null); if (null == leaf) return NotFound(new { id, version }); return Ok(leaf); diff --git a/src/isnd/Controllers/Packages/PackagesController.WebViews.cs b/src/isnd/Controllers/Packages/PackagesController.WebViews.cs index d392066..979377f 100644 --- a/src/isnd/Controllers/Packages/PackagesController.WebViews.cs +++ b/src/isnd/Controllers/Packages/PackagesController.WebViews.cs @@ -27,10 +27,10 @@ namespace isnd.Controllers Source = packageManager.CatalogBaseUrl+ApiConfig.Index, Query = model }; - List registrations = new List(); + List registrations = new List(); 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); } diff --git a/src/isnd/Data/Catalog/PackageDetails.cs b/src/isnd/Data/Catalog/PackageDetails.cs index 1a2fc25..c831014 100644 --- a/src/isnd/Data/Catalog/PackageDetails.cs +++ b/src/isnd/Data/Catalog/PackageDetails.cs @@ -16,7 +16,7 @@ using isnd.Entities; namespace isnd.Data.Catalog { - public class PackageDetails : Permalink, IObject, IPackageSearchMetadata + public class PackageDetails : Permalink, IObject { /// /// Creates a catalog entry @@ -24,7 +24,7 @@ namespace isnd.Data.Catalog /// package id /// api Base /// - public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Registration + "/" + pkg.PackageId + "/" + pkg.FullString + ".json") + public PackageDetails(PackageVersion pkg, string apiBase): base( apiBase + ApiConfig.Package + "/" + pkg.PackageId + "/" + pkg.FullString) { Title = PackageId = pkg.Package.Id; Version = pkg.FullString; @@ -32,80 +32,18 @@ namespace isnd.Data.Catalog packageContent = apiBase + pkg.NugetLink; CommitId = pkg.CommitId; Published = CommitTimeStamp = pkg.LatestCommit.CommitTimeStamp; - IsListed = !pkg.IsDeleted && pkg.Package.Public; + Listed = !pkg.IsDeleted && pkg.Package.Public; if (pkg.DependencyGroups!=null) { DependencySets = pkg.DependencyGroups; } - PackageDetailsUrl = new Uri(this.id); - // TODO Licence Project Urls, Summary, Title, Owners, etc ... } [JsonProperty("@type")] public string[] RefType { get; protected set; } = new string[] { "PackageDetails" }; - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public PackageDetails(string apiBase, string pkgId, string pkgVersionString, string commitId, DateTimeOffset commitTimeStamp, string authors, Deprecation deprecation, string description, Uri iconUrl, string language, Uri licenseUrl, string licenseExpression, string minClientVersion, Uri projectUrl, bool requireLicenseAcceptance, string summary, string tags, string title, string packageContent, string version, PackageIdentity identity, Uri readmeUrl, Uri reportAbuseUrl, Uri packageDetailsUrl, string owners, bool isListed, bool prefixReserved, LicenseMetadata licenseMetadata) - : base( apiBase + ApiConfig.Registration + "/" + pkgId + "/" + pkgVersionString + ".json") - { - this.CommitId = commitId; - this.CommitTimeStamp = commitTimeStamp; - this.Authors = authors; - this.deprecation = deprecation; - this.Description = description; - this.IconUrl = iconUrl; - this.language = language; - this.LicenseUrl = licenseUrl; - this.licenseExpression = licenseExpression; - this.minClientVersion = minClientVersion; - this.ProjectUrl = projectUrl; - this.RequireLicenseAcceptance = requireLicenseAcceptance; - this.Summary = summary; - this.Tags = tags; - this.Title = title; - this.packageContent = packageContent; - this.Version = version; - this.Identity = identity; - this.ReadmeUrl = readmeUrl; - this.ReportAbuseUrl = reportAbuseUrl; - this.PackageDetailsUrl = packageDetailsUrl; - this.Owners = owners; - this.IsListed = isListed; - this.PrefixReserved = prefixReserved; - this.LicenseMetadata = licenseMetadata; - - } + [JsonProperty("commitId")] public string CommitId { get; set; } @@ -198,22 +136,19 @@ namespace isnd.Data.Catalog public Uri ReportAbuseUrl { get; set; } - public Uri PackageDetailsUrl { get; set; } - public string Owners { get; set; } - [JsonProperty("isListed")] - public bool IsListed { get; set; } + public bool Listed { get; set; } public bool PrefixReserved { get; set; } public LicenseMetadata LicenseMetadata { get; set; } + + [JsonProperty("dependencyGroups")] public IEnumerable DependencySets {get; set;} - IEnumerable IPackageSearchMetadata.DependencySets => throw new NotImplementedException(); - public Task GetDeprecationMetadataAsync() { throw new NotImplementedException(); diff --git a/src/isnd/Data/Catalog/PackageRegistration.cs b/src/isnd/Data/Catalog/PackageRegistration.cs index 9bca29c..70adbf2 100644 --- a/src/isnd/Data/Catalog/PackageRegistration.cs +++ b/src/isnd/Data/Catalog/PackageRegistration.cs @@ -7,15 +7,15 @@ using System.Linq; namespace isnd.Data.Catalog { - public class PackageRegistration : Permalink + public class Catalog : Permalink { - public PackageRegistration(string url) : base(url) + public Catalog(string url) : base(url) { Items = new List(); } - public PackageRegistration(string apiBase, string pkgId, IEnumerable versions) : base($"{apiBase}{ApiConfig.Registration}/{pkgId}/index.json") + public Catalog(string apiBase, string pkgId, IEnumerable versions) : base($"{apiBase}{ApiConfig.Registration}/{pkgId}/index.json") { Items = new List { diff --git a/src/isnd/Data/Catalog/CatalogPage.cs b/src/isnd/Data/Catalog/RegistrationPage.cs similarity index 100% rename from src/isnd/Data/Catalog/CatalogPage.cs rename to src/isnd/Data/Catalog/RegistrationPage.cs diff --git a/src/isnd/Interfaces/IPackageManager.cs b/src/isnd/Interfaces/IPackageManager.cs index bff3d9f..fc79c6a 100644 --- a/src/isnd/Interfaces/IPackageManager.cs +++ b/src/isnd/Interfaces/IPackageManager.cs @@ -18,15 +18,15 @@ namespace isnd.Interfaces string[] GetVersions(string pkgid, NuGetVersion parsedVersion, bool prerelease = false, string packageType = null, int skip = 0, int take = 25); IEnumerable GetResources(); - Task UpdateCatalogForAsync(Commit commit); + Task UpdateCatalogForAsync(Commit commit); Task DeletePackageAsync(string pkgid, string version, string type); Task UserAskForPackageDeletionAsync(string userid, string pkgId, string lower, string type); - Task GetPackageAsync(string pkgid, string version, string type); + Task GetPackageDetailsAsync(string pkgid, string version, string type=null); Task GetCatalogEntryAsync(string pkgId, string version, string pkgType); IEnumerable SearchCatalogEntriesById(string pkgId, string semver, string pkgType, bool preRelease); - Task GetCatalogIndexAsync(); - Task GetPackageRegistrationIndexAsync(PackageRegistrationQuery query); + Task GetCatalogIndexAsync(); + Task GetPackageRegistrationIndexAsync(PackageRegistrationQuery query); Task SearchPackageAsync(PackageRegistrationQuery query); diff --git a/src/isnd/Services/PackageManager.cs b/src/isnd/Services/PackageManager.cs index adfbbf2..599a7c3 100644 --- a/src/isnd/Services/PackageManager.cs +++ b/src/isnd/Services/PackageManager.cs @@ -47,7 +47,7 @@ namespace isnd.Services }, // under dev, only leash in release mode - new Resource(apiBase + ApiConfig.Package + "/{id}/{version}", + new Resource(apiBase + ApiConfig.PackageDetailUriTemplate, "PackageDetailsUriTemplate/5.1.0") { Comment = "URI template used by NuGet Client to construct details URL for packages" @@ -141,19 +141,19 @@ namespace isnd.Services private IsndSettings isndSettings; private readonly string apiBase; - public virtual async Task GetCatalogIndexAsync() + public virtual async Task GetCatalogIndexAsync() { return await UpdateCatalogForAsync(null); } - public async Task UpdateCatalogForAsync + public async Task UpdateCatalogForAsync (Commit reason = null) { int i = 0; string baseId = apiBase + ApiConfig.Catalog; string baseRegistrationId = $"{apiBase}{ApiConfig.Registration}"; - PackageRegistration index = new PackageRegistration(baseId); + Catalog index = new Catalog(baseId); var scope = await dbContext.Commits.OrderBy(c => c.TimeStamp).ToArrayAsync(); @@ -214,14 +214,25 @@ namespace isnd.Services return new PackageDeletionReport { Deleted = true, DeletedVersion = pkg }; } - public async Task GetPackageAsync + public async Task GetPackageDetailsAsync (string pkgId, string version, string type) { - return await dbContext.PackageVersions.SingleOrDefaultAsync( + var pkg = await dbContext.PackageVersions + .Include(v=>v.Package) + .Include(v=>v.Package.Owner) + .Include(v=>v.LatestCommit) + .Include(v=>v.DependencyGroups) + .SingleOrDefaultAsync( v => v.PackageId == pkgId && v.FullString == version && - (type==null || v.Type == type) - ); + (type==null || v.Type == type)) + ; + if (pkg == null) return null; + foreach (var g in pkg.DependencyGroups) + { + g.Dependencies = dbContext.Dependencies.Where(d => d.DependencyGroupId == g.Id).ToList(); + } + return new PackageDetails(pkg, apiBase); } public async Task GetCatalogEntryAsync @@ -286,7 +297,7 @@ namespace isnd.Services && (pkgType == null || pkgType == v.Type)); } - public async Task GetPackageRegistrationIndexAsync + public async Task GetPackageRegistrationIndexAsync (PackageRegistrationQuery query) { if (string.IsNullOrWhiteSpace(query.Query)) return null; @@ -306,7 +317,7 @@ namespace isnd.Services .ToList(); version.LatestCommit = dbContext.Commits.Single(c => c.Id == version.CommitNId); } - return new PackageRegistration(apiBase, query.Query, scope); + return new Catalog(apiBase, query.Query, scope); } public async Task SearchPackageAsync(PackageRegistrationQuery query) diff --git a/src/isnd/ViewModels/RegistrationPageIndexQueryAndResult.cs b/src/isnd/ViewModels/RegistrationPageIndexQueryAndResult.cs index e9ba766..db234d1 100644 --- a/src/isnd/ViewModels/RegistrationPageIndexQueryAndResult.cs +++ b/src/isnd/ViewModels/RegistrationPageIndexQueryAndResult.cs @@ -7,6 +7,6 @@ namespace isnd { public string Source { get; set; } public PackageRegistrationQuery Query { get; set; } - public PackageRegistration[] Result { get; set; } + public Catalog[] Result { get; set; } } } \ No newline at end of file diff --git a/src/isnd/isnd.csproj b/src/isnd/isnd.csproj index 4215863..8a0eebf 100644 --- a/src/isnd/isnd.csproj +++ b/src/isnd/isnd.csproj @@ -13,33 +13,33 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - + + - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - + + All - + - + diff --git a/test/isn.tests/isn.tests.csproj b/test/isn.tests/isn.tests.csproj index 34f6b0a..bca35bb 100644 --- a/test/isn.tests/isn.tests.csproj +++ b/test/isn.tests/isn.tests.csproj @@ -9,11 +9,11 @@ 1.0.7 - - + + - - + + diff --git a/test/isnd.tests/UnitTestWebHost.cs b/test/isnd.tests/UnitTestWebHost.cs index c1a619d..6a9fe71 100644 --- a/test/isnd.tests/UnitTestWebHost.cs +++ b/test/isnd.tests/UnitTestWebHost.cs @@ -15,6 +15,7 @@ using NuGet.Protocol.Core.Types; using isn.abst; using NuGet.Common; using System.Collections.Generic; +using NuGet.Versioning; namespace isnd.host.tests { @@ -58,7 +59,6 @@ namespace isnd.host.tests } - [Fact] public void NugetInstallsTest() { using (var serviceScope = server.Host.Services.CreateScope()) @@ -83,7 +83,7 @@ namespace isnd.host.tests using (var serviceScope = server.Host.Services.CreateScope()) { var isnSettings = serviceScope.ServiceProvider.GetService>().Value; - string pkgSourceUrl = isnSettings.ExternalUrl + apiindex; + string pkgSourceUrl = isnSettings.ExternalUrl + apiindex+ ".json"; NullThrottle throttle = new NullThrottle(); PackageSource packageSource = new PackageSource(pkgSourceUrl); @@ -99,7 +99,7 @@ namespace isnd.host.tests using (var serviceScope = server.Host.Services.CreateScope()) { var isnSettings = serviceScope.ServiceProvider.GetService>().Value; - string pkgSourceUrl = isnSettings.ExternalUrl + apiindex; + string pkgSourceUrl = isnSettings.ExternalUrl + apiindex+ ".json"; var prov = new RegistrationResourceV3Provider(); var source = new PackageSource(pkgSourceUrl); var repo = new SourceRepository(source, new INuGetResourceProvider[] { prov }); @@ -137,7 +137,7 @@ namespace isnd.host.tests Assert.NotEmpty(packages); - foreach (IPackageSearchMetadata package in packages) + foreach (var package in packages) { Console.WriteLine($"Version: {package.Identity.Version}"); Console.WriteLine($"Listed: {package.IsListed}"); @@ -173,6 +173,7 @@ namespace isnd.host.tests [Fact] public async Task TestPackagePush() { + server.EnsureUser(server.TestingUserName); var logger = new TestLogger(); SourceRepository repository = Repository.Factory.GetCoreV3(SPIIndexURI); PackageUpdateResource pushRes = await repository.GetResourceAsync(); @@ -183,13 +184,16 @@ namespace isnd.host.tests } - [Fact] - public void TestDepedency() + // not yet from testing url a [Fact] + public async Task TestGetPackageUri() { - PackageDependencyGroup g = new PackageDependencyGroup - { - TargetFramework="net7.0" - }; + PackageSource source = new PackageSource("https://isn.pschneider.fr/v3/index.json"); + source.ProtocolVersion=3; + SourceRepository repository = Repository.Factory.GetCoreV3(source); + string index = repository.ToJson(); + PackageDetailsUriResourceV3 uriRes = await repository.GetResourceAsync(); + Assert.NotNull(uriRes);// package details Uri Resource + Uri u = uriRes.GetUri("isn.abst", new NuGetVersion("1.0.24")); } private string GetSymbolsApiKey(string apiUrl) diff --git a/test/isnd.tests/WebServerFixture.cs b/test/isnd.tests/WebServerFixture.cs index e241b40..75e1095 100644 --- a/test/isnd.tests/WebServerFixture.cs +++ b/test/isnd.tests/WebServerFixture.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Net; using isn; using isnd.Data; using isnd.Entities; @@ -31,6 +32,10 @@ namespace isnd.tests private IsndSettings siteSettings; public IDataProtector DataProtector { get; private set; } + + public ApplicationDbContext dbContext { get; private set; } + + public string TestingUserName { get; private set; } public string ProtectedTestingApiKey { get; internal set; } public ApplicationUser TestingUser { get; private set; } @@ -49,19 +54,19 @@ namespace isnd.tests { var builder = WebHost.CreateDefaultBuilder(new string[0]); - // .UseContentRoot("../../../../../src/isnd") - builder.UseStartup(typeof(Startup)) - .ConfigureAppConfiguration((builderContext, config) => - { - config.AddJsonFile("appsettings.json", true); - config.AddJsonFile("appsettings.Development.json", false); - }); + // .UseContentRoot("../../../../../src/isnd") + builder.UseStartup(typeof(Startup)) + .ConfigureAppConfiguration((builderContext, config) => + { + config.AddJsonFile("appsettings.json", true); + config.AddJsonFile("appsettings.Development.json", false); + }); Host = builder.Build(); var logFactory = Host.Services.GetRequiredService(); Logger = logFactory.CreateLogger(); - + Host.Start(); //Starts listening on the configured addresses. var server = Host.Services.GetRequiredService(); @@ -76,38 +81,47 @@ namespace isnd.tests DataProtector = Host.Services.GetRequiredService() .CreateProtector(siteSettings.ProtectionTitle); - var dbContext = Host.Services.GetRequiredService(); - string testingUserName = "Tester"; - TestingUser = dbContext.Users.FirstOrDefault(u=>u.UserName==testingUserName); - if (TestingUser==null) - { - var userManager = Host.Services.GetRequiredService>(); - TestingUser = new ApplicationUser - { - UserName=testingUserName - }; - - var result = userManager.CreateAsync(TestingUser).Result; - - Assert.True(result.Succeeded); - TestingUser = dbContext.Users.FirstOrDefault(u=>u.UserName==testingUserName); - } - var testKey = dbContext.ApiKeys.FirstOrDefault(k=>k.UserId==TestingUser.Id); + dbContext = Host.Services.GetRequiredService(); + TestingUserName = "Tester"; + TestingUser = dbContext.Users.FirstOrDefault(u => u.UserName == TestingUserName); + EnsureUser(TestingUserName); + var testKey = dbContext.ApiKeys.FirstOrDefault(k => k.UserId == TestingUser.Id); if (testKey == null) { var keyProvider = Host.Services.GetService(); var apiKeyQuery = new Data.ApiKeys.CreateModel - { - Name = "Testing Key", - UserId = TestingUser.Id, - ValidityPeriodInDays = 1 + { + Name = "Testing Key", + UserId = TestingUser.Id, + ValidityPeriodInDays = 1 - }; + }; testKey = keyProvider.CreateApiKeyAsync(apiKeyQuery).Result; } ProtectedTestingApiKey = DataProtector.Protect(testKey.Id); + + ServicePointManager.ServerCertificateValidationCallback = + (sender, cert, chain, sslPolicyErrors) => true; + + } + + public void EnsureUser(string testingUserName) + { + if (TestingUser == null) + { + var userManager = Host.Services.GetRequiredService>(); + TestingUser = new ApplicationUser + { + UserName = testingUserName + }; + + var result = userManager.CreateAsync(TestingUser).Result; + + Assert.True(result.Succeeded); + TestingUser = dbContext.Users.FirstOrDefault(u => u.UserName == testingUserName); + } } } } \ No newline at end of file diff --git a/test/isnd.tests/appsettings.json b/test/isnd.tests/appsettings.json index 26d0818..ae90f0b 100644 --- a/test/isnd.tests/appsettings.json +++ b/test/isnd.tests/appsettings.json @@ -13,9 +13,6 @@ }, "Kestrel": { "Endpoints": { - "Http": { - "Url": "http://127.0.0.1:5002" - }, "Https": { "Url": "https://127.0.0.1:5003" } diff --git a/test/isnd.tests/isnd.tests.csproj b/test/isnd.tests/isnd.tests.csproj index 35e64e5..5e22d03 100644 --- a/test/isnd.tests/isnd.tests.csproj +++ b/test/isnd.tests/isnd.tests.csproj @@ -10,12 +10,12 @@ 1.0.7 - - - + + + - - + + diff --git a/test/isnd.tests/test-index.json b/test/isnd.tests/test-index.json new file mode 100644 index 0000000..41908a9 --- /dev/null +++ b/test/isnd.tests/test-index.json @@ -0,0 +1,20 @@ +{ + "FeedTypeOverride": "undefined", + "PackageSource": { + "Name": "http://127.0.0.1:5000/v3/index.json", + "Source": "http://127.0.0.1:5000/v3/index.json", + "TrySourceAsUri": "http://127.0.0.1:5000/v3/index.json", + "SourceUri": "http://127.0.0.1:5000/v3/index.json", + "IsOfficial": false, + "IsMachineWide": false, + "IsEnabled": true, + "IsPersistable": true, + "MaxHttpRequestsPerSource": 0, + "ProtocolVersion": 2, + "AllowInsecureConnections": false, + "DisableTLSCertificateValidation": false, + "IsHttp": true, + "IsHttps": false, + "IsLocal": false + } +} \ No newline at end of file