public void TestPrettyString(string expected, Reason reason) { var pool = new Pool(); var package1 = Helper.MockPackage("foo", "2.1"); var package2 = Helper.MockPackage("baz", "1.1"); var repository = Helper.MockRepository(package1, package2); pool.AddRepository(repository); var rule = new RuleGeneric(new[] { package1.Id, -package2.Id }, reason, null); Assert.AreEqual(expected, rule.GetPrettyString(pool)); }
public void TestPrettyStringWithRequire() { var pool = new Pool(); var package1 = Helper.MockPackage("foo", "2.1"); var package2 = Helper.MockPackage("baz", "1.1"); var package3 = Helper.MockPackage("boo", "1.2"); var package4 = Helper.MockPackage("boo", "6.8"); var repository = Helper.MockRepository(package1, package2, package3, package4); pool.AddRepository(repository); var link = new Link("foo", "boo", new Constraint("=", "1.2")); var rule = new RuleGeneric(new[] { -package1.Id, package2.Id, package3.Id, package4.Id }, Reason.PackageRequire, link); Assert.AreEqual("foo 2.1 relates to boo == 1.2 -> satisfiable by baz[1.1], boo[1.2, 6.8].", rule.GetPrettyString(pool)); }