コード例 #1
0
        public void TestCanAddRelationship()
        {
            LocatorRelationshipInfo  lri  = LocatorRelationshipInfo.CreateObj("label", "1", 1F, 1F, "pref label", "1", false);
            LocatorRelationshipInfo  lri2 = LocatorRelationshipInfo.CreateObj("label", "2", 1F, 1F, "pref label", "1", false);
            ChildPresentationLocator cpl  = new ChildPresentationLocator("href1", lri);

            Assert.IsFalse(cpl.CanAddRelationship(lri), "can add dup");
            Assert.IsTrue(cpl.CanAddRelationship(lri2), "can't add new val");
        }
コード例 #2
0
        public void TestAddReplaceRelationship()
        {
            LocatorRelationshipInfo lri  = LocatorRelationshipInfo.CreateObj("label", "1", 1F, 1F, "pref label", "1", false);
            LocatorRelationshipInfo lri2 = LocatorRelationshipInfo.CreateObj("label", "2", 1F, 1F, "pref label", "1", true);

            TestChildPresentationLocator cpl = new TestChildPresentationLocator("href1", lri);

            cpl.AddRelationship(lri2);

            Assert.AreEqual(1, cpl.LocatorRelationshipInfos.Count, "wrong number of LRI's");
            Assert.AreEqual(lri2, cpl.LocatorRelationshipInfos[0], "LRI is wrong");
        }