コード例 #1
0
        public void TestFindUpdatePackages()
        {
            var barReplaces = new[]
            {
                new Link("bar", "foo", new Constraint("=", "3.0"), "replaces"),
            };

            var packageFoo1 = Helper.MockPackage("foo", "1.0");
            var packageFoo2 = Helper.MockPackage("foo", "2.0");
            var packageBar  = Helper.MockPackage("bar", "2.0", null, barReplaces);
            var packageBaz  = Helper.MockPackage("baz", "2.0");

            repository.AddPackage(packageFoo1);
            repository.AddPackage(packageFoo2);
            repository.AddPackage(packageBar);
            repository.AddPackage(packageBaz);

            pool.AddRepository(repository);

            var expected = new[] { packageFoo2, packageBar };

            var actual = policy.FindUpdatePackages(pool, GetInstalledMap(), packageFoo1);

            CollectionAssert.AreEqual(expected, actual);
        }