Example #1
0
        public void TestRemoveWrappers()
        {
            TestLinkableImpl mw1 = new TestLinkableImpl("key 1");
            TestLinkableImpl fw1 = new TestLinkableImpl("foot b");

            mw1.Link(fw1);

            TestLinkableImpl fw2 = new TestLinkableImpl("foot c");

            mw1.Link(fw2);

            TestLinkableImpl fw3 = new TestLinkableImpl("foot a");

            mw1.Link(fw3);

            mw1.Unlink(fw1);

            Assert.AreEqual(2, mw1._linker.links.Count, "wrong number of associated wrappers");

            Assert.IsTrue(mw1._linker.links.ContainsKey("foot c"), "mw1 missing foot c");
            Assert.IsTrue(mw1._linker.links.ContainsKey("foot a"), "mw1 missing foot a");

            Assert.IsTrue(fw2._linker.links.Count == 1, "wrong count for fw2");
            Assert.IsTrue(fw3._linker.links.Count == 1, "wrong count for fw3");
        }
Example #2
0
        public void TestAddWrappers()
        {
            TestLinkableImpl mw1 = new TestLinkableImpl("key 1");
            TestLinkableImpl fw1 = new TestLinkableImpl("foot b");

            mw1.Link(fw1);

            TestLinkableImpl fw2 = new TestLinkableImpl("foot c");

            mw1.Link(fw2);

            TestLinkableImpl fw3 = new TestLinkableImpl("foot a");

            mw1.Link(fw3);

            Assert.IsTrue(((ILinkable)mw1).IsLinkedTo(fw1), "footnotes a wrong");
            Assert.IsTrue(((ILinkable)mw1).IsLinkedTo(fw2), "footnotes b wrong");
            Assert.IsTrue(((ILinkable)mw1).IsLinkedTo(fw3), "footnotes c wrong");
        }
Example #3
0
        public void TestRemoveWrappers()
        {
            TestLinkableImpl mw1 = new TestLinkableImpl( "key 1");
            TestLinkableImpl fw1 = new TestLinkableImpl( "foot b" );

            mw1.Link( fw1 );

            TestLinkableImpl fw2 = new TestLinkableImpl( "foot c" );

            mw1.Link( fw2 );

            TestLinkableImpl fw3 = new TestLinkableImpl( "foot a" );

            mw1.Link( fw3 );

            mw1.Unlink( fw1 );

            Assert.AreEqual( 2, mw1._linker.links.Count, "wrong number of associated wrappers" );

            Assert.IsTrue( mw1._linker.links.ContainsKey( "foot c" ), "mw1 missing foot c"  );
            Assert.IsTrue( mw1._linker.links.ContainsKey( "foot a" ), "mw1 missing foot a"  );

            Assert.IsTrue( fw2._linker.links.Count == 1, "wrong count for fw2" );
            Assert.IsTrue( fw3._linker.links.Count == 1, "wrong count for fw3" );
        }
Example #4
0
        public void TestAddWrappers()
        {
            TestLinkableImpl mw1 = new TestLinkableImpl("key 1");
            TestLinkableImpl fw1 = new TestLinkableImpl( "foot b");
            mw1.Link( fw1 );

            TestLinkableImpl fw2 = new TestLinkableImpl( "foot c" );
            mw1.Link( fw2 );

            TestLinkableImpl fw3 = new TestLinkableImpl( "foot a" );
            mw1.Link( fw3 );

            Assert.IsTrue( ((ILinkable)mw1).IsLinkedTo( fw1 ), "footnotes a wrong" );
            Assert.IsTrue( ((ILinkable)mw1).IsLinkedTo( fw2 ), "footnotes b wrong" );
            Assert.IsTrue( ((ILinkable)mw1).IsLinkedTo( fw3 ), "footnotes c wrong" );
        }