Beispiel #1
0
 internal static string BuildNugetUpstreamId([NotNull] this SnapApp snapApp)
 {
     if (snapApp == null)
     {
         throw new ArgumentNullException(nameof(snapApp));
     }
     return(snapApp.IsFull ? snapApp.BuildNugetFullUpstreamId() : snapApp.BuildNugetDeltaUpstreamId());
 }
Beispiel #2
0
        public void TestBuildNugetDeltaUpstreamId_SnapApp()
        {
            var snapApp = new SnapApp
            {
                Id      = "demoapp",
                Version = new SemanticVersion(1, 0, 0, "preview-123"),
                IsFull  = true,
                Target  = new SnapTarget
                {
                    Os        = OSPlatform.Windows,
                    Framework = "netcoreapp2.1",
                    Rid       = "win7-x64"
                }
            };

            var expectedPackageId = $"{snapApp.Id}_full_{snapApp.Target.Rid}_snapx".ToLowerInvariant();

            var actualPackageId = snapApp.BuildNugetFullUpstreamId();

            Assert.Equal(expectedPackageId, actualPackageId);
        }