public void WhenThereIsOneInput_ItIsTheTarget()
        {
            var updateSets = PackageUpdates.UpdateFooFromOneVersion()
                             .InList();

            var target = MakeSelection();

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

            Assert.That(results, Is.Not.Null);
            Assert.That(results.Count, Is.EqualTo(1));
            Assert.That(results.First().SelectedId, Is.EqualTo("foo"));
        }
示例#2
0
        public async Task WhenThereIsOneInput_ItIsTheTarget()
        {
            var updateSets = PackageUpdates.UpdateFooFromOneVersion()
                             .InList();

            var target = SelectionForFilter(BranchFilter(true));

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

            Assert.That(results, Is.Not.Null);
            Assert.That(results.Count, Is.EqualTo(1));
            Assert.That(results.First().SelectedId, Is.EqualTo("foo"));
        }
        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"));
        }
示例#4
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));
        }
示例#5
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"));
        }