Ejemplo n.º 1
0
        public void DependencyWishList_Resolved()
        {
            var cache = new InMemoryDependencyCache();
            cache.Add(ModuleWith("A", "1.0"));
            cache.Add(ModuleWith("A", "1.1"));
            cache.Add(ModuleWith("A", "1.3"));
            cache.Add(ModuleWith("A", "2.0"));

            var wish = WishWith("A", "[1.1,2.0)");

            var set = new ResolverWishSet(WishWith("A", "1.3"), cache);

            set.AddIfNotExists(WishWith("A", "1.3"));
            Assert.IsTrue(set.IsFixed(), "expect resolved as only one matching dep");
            Assert.IsTrue(set.CanMatch(), "expect can match");
        }
Ejemplo n.º 2
0
        public void DependencyWishlist_HasNoMatches()
        {
            var cache = new InMemoryDependencyCache();
            cache.Add(ModuleWith("A", "1.0"));
            cache.Add(ModuleWith("A", "1.1"));
            cache.Add(ModuleWith("A", "1.3"));
            cache.Add(ModuleWith("A", "2.0"));

            var wish = WishWith("A", "[1.1,2.0)");

            var set = new ResolverWishSet(wish, cache);

            set.AddIfNotExists(WishWith("A", "(3.0]"));
            Assert.IsFalse(set.IsFixed(), "expect not resolved as no matching deps");
            Assert.IsFalse(set.CanMatch(), "expect no possible matches");
        }