Ejemplo n.º 1
0
 internal static string BuildNugetFilename([NotNull] this SnapApp snapApp)
 {
     if (snapApp == null)
     {
         throw new ArgumentNullException(nameof(snapApp));
     }
     return(snapApp.IsFull ? snapApp.BuildNugetFullFilename() : snapApp.BuildNugetDeltaFilename());
 }
Ejemplo n.º 2
0
        public void TestBuildNugetFullFilename_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.{snapApp.Version.ToNormalizedString()}.nupkg".ToLowerInvariant();

            var actualPackageId = snapApp.BuildNugetFullFilename();

            Assert.Equal(expectedPackageId, actualPackageId);
        }