예제 #1
0
        public void TestFindPackages()
        {
            repositoryOne.AddPackage(Helper.MockPackage("foo", "1.0"));
            repositoryOne.AddPackage(Helper.MockPackage("foo", "2.0"));
            repositoryOne.AddPackage(Helper.MockPackage("baz", "1.0"));

            repositoryTwo.AddPackage(Helper.MockPackage("bar", "1.0"));
            repositoryTwo.AddPackage(Helper.MockPackage("bar", "2.0"));
            repositoryTwo.AddPackage(Helper.MockPackage("foo", "3.0"));

            var bazs = repositoryComposite.FindPackages("baz");

            Assert.AreEqual(1, bazs.Length);
            Assert.AreEqual("baz", bazs[0].GetName());

            var bars = repositoryComposite.FindPackages("bar");

            Assert.AreEqual(2, bars.Length);
            Assert.AreEqual("bar", bars[0].GetName());

            var foos = repositoryComposite.FindPackages("foo");

            Assert.AreEqual(3, foos.Length);
            Assert.AreEqual("foo", foos[0].GetName());
        }