示例#1
0
        public async Task WhenExistingBranchesAreFilteredOut()
        {
            var updateSets = new List <PackageUpdateSet>
            {
                PackageUpdates.UpdateFooFromOneVersion(),
                PackageUpdates.UpdateBarFromTwoVersions()
            };

            var filter = BranchFilter(false);

            var target = SelectionForFilter(filter);

            var results = await target.SelectTargets(PushFork(), updateSets, NoFilter(), DefaultBranchSettings());

            Assert.That(results.Count, Is.EqualTo(0));
        }
        public void WhenThereAreTwoInputs_MoreVersionsSecond_SecondIsTheTarget()
        {
            // sort should change this ordering
            var updateSets = new List <PackageUpdateSet>
            {
                PackageUpdates.UpdateFooFromOneVersion(),
                PackageUpdates.UpdateBarFromTwoVersions()
            };

            var target = MakeSelection();

            var results = target.SelectTargets(PushFork(), updateSets, NoFilter());

            Assert.That(results.Count, Is.EqualTo(2));
            Assert.That(results.First().SelectedId, Is.EqualTo("bar"));
        }
示例#3
0
        public async Task WhenThereAreTwoInputs_MoreVersionsSecond_SecondIsTheTarget()
        {
            // sort should change this ordering
            var updateSets = new List <PackageUpdateSet>
            {
                PackageUpdates.UpdateFooFromOneVersion(),
                PackageUpdates.UpdateBarFromTwoVersions()
            };

            var target = SelectionForFilter(BranchFilter(true));

            var results = await target.SelectTargets(PushFork(), updateSets, NoFilter(), DefaultBranchSettings());

            Assert.That(results.Count, Is.EqualTo(2));
            Assert.That(results.First().SelectedId, Is.EqualTo("bar"));
        }