public void WhenThereAreMultipleVersionsOutOfOrder()
        {
            var current    = new NuGetVersion(1, 2, 3);
            var candidates = new List <PackageSearchMedatadata>
            {
                MetadataForVersion(1, 3, 4),
                MetadataForVersion(2, 3, 4),
                MetadataForVersion(1, 2, 4),
                MetadataForVersion(3, 3, 4),
                MetadataForVersion(1, 5, 6),
                MetadataForVersion(2, 5, 6),
                MetadataForVersion(5, 6, 7),
                MetadataForVersion(1, 1, 1),
                MetadataForVersion(1, 2, 9),
                MetadataForVersion(0, 1, 1)
            };

            var result = VersionChanges.MakeVersions(current, candidates, VersionChange.Major);

            Assert.That(result.AllowedChange, Is.EqualTo(VersionChange.Major));
            Assert.That(result.Selected(), Is.EqualTo(result.Major));

            Assert.That(result.Major.Identity.Version, Is.EqualTo(new NuGetVersion(5, 6, 7)));
            Assert.That(result.Minor.Identity.Version, Is.EqualTo(new NuGetVersion(1, 5, 6)));
            Assert.That(result.Patch.Identity.Version, Is.EqualTo(new NuGetVersion(1, 2, 9)));
        }
        public void WhenThereAreNewMajorMinorAndPatchVersion()
        {
            var current    = new NuGetVersion(1, 2, 3);
            var candidates = new List <PackageSearchMedatadata>
            {
                MetadataForVersion(2, 3, 4),
                MetadataForVersion(1, 3, 4),
                MetadataForVersion(1, 2, 4)
            };

            var result = VersionChanges.MakeVersions(current, candidates, VersionChange.Major);

            Assert.That(result.AllowedChange, Is.EqualTo(VersionChange.Major));
            Assert.That(result.Major, Is.Not.Null);
            Assert.That(result.Major.Identity.Version, Is.EqualTo(new NuGetVersion(2, 3, 4)));

            Assert.That(result.Minor, Is.Not.Null);
            Assert.That(result.Minor.Identity.Version, Is.EqualTo(new NuGetVersion(1, 3, 4)));

            Assert.That(result.Patch, Is.Not.Null);
            Assert.That(result.Patch.Identity.Version, Is.EqualTo(new NuGetVersion(1, 2, 4)));

            Assert.That(result.Selected(), Is.EqualTo(result.Major));
            Assert.That(result.Selected().Identity.Version, Is.EqualTo(new NuGetVersion(2, 3, 4)));
        }
Exemplo n.º 3
0
 public void Initialize(string versionName)
 {
     Clear();
     VersionName = versionName;
     VersionChanges.Add("Narocad now works with sketch.");
     VersionChanges.Add("Constraints were added.");
     VersionChanges.Add("Some tools were temporarly removed.");
     VersionChanges.Add("New background.");
     VersionDescription = "";
 }
        public void WhenThereAreNoCandidates()
        {
            var current    = new NuGetVersion(1, 2, 3);
            var candidates = new List <PackageSearchMedatadata>();

            var result = VersionChanges.MakeVersions(current, candidates, VersionChange.Major);

            Assert.That(result, Is.Not.Null);
            Assert.That(result.AllowedChange, Is.EqualTo(VersionChange.Major));
            Assert.That(result.Major, Is.Null);
            Assert.That(result.Minor, Is.Null);
            Assert.That(result.Patch, Is.Null);
            Assert.That(result.Selected(), Is.Null);
        }
        public void WhenThereIsANewMajorVersion()
        {
            var current    = new NuGetVersion(1, 2, 3);
            var candidates = MetadataForVersion(2, 3, 4)
                             .InList();

            var result = VersionChanges.MakeVersions(current, candidates, VersionChange.Major);

            Assert.That(result.Major, Is.Not.Null);
            Assert.That(result.Selected(), Is.EqualTo(result.Major));
            Assert.That(result.Major.Identity.Version, Is.EqualTo(new NuGetVersion(2, 3, 4)));

            Assert.That(result.Minor, Is.Null);
            Assert.That(result.Patch, Is.Null);
        }
Exemplo n.º 6
0
        public MainWindowVM(UploaderCfg uploaderCfg, UploaderClient1 uploaderClient1, DeleterClient1 deleterClient1)
        {
            Config   = uploaderCfg;
            Uploader = uploaderClient1;
            Deleter  = deleterClient1;
            Title    = $"Repo 1 Uploader  :  “{Config.Username}”  :  {Config.ApiBaseURL}";
            LocalExe = FindLocalExe();
            if (LocalExe == null)
            {
                return;
            }

            RefreshCmd = R1Command.Async(CompareWithRemote);
            UploadCmd  = R1Command.Async(PublishLocalExe,
                                         x => HasChanges && !VersionChanges.IsBlank(), "Upload");
            UploadCmd.DisableWhenDone = true;

            RefreshCmd.ExecuteIfItCan();
        }
Exemplo n.º 7
0
        public void WhenThereAreOnlyNewPatchVersion()
        {
            var current    = new NuGetVersion(1, 2, 3);
            var candidates = new List <PackageSearchMetadata>
            {
                MetadataForVersion(1, 2, 7),
                MetadataForVersion(1, 2, 5),
                MetadataForVersion(1, 2, 4),
                MetadataForVersion(1, 2, 6),
                MetadataForVersion(1, 2, 8)
            };

            var result = VersionChanges.MakeVersions(current, candidates, VersionChange.Major);

            Assert.That(result.AllowedChange, Is.EqualTo(VersionChange.Major));
            Assert.That(result.Major.Identity.Version, Is.EqualTo(new NuGetVersion(1, 2, 8)));

            Assert.That(result.Selected(), Is.EqualTo(result.Major));
            Assert.That(result.Selected(), Is.EqualTo(result.Minor));
            Assert.That(result.Selected(), Is.EqualTo(result.Patch));
            Assert.That(result.Major, Is.EqualTo(result.Minor));
            Assert.That(result.Major, Is.EqualTo(result.Patch));
        }