Beispiel #1
0
        public void Test_XmlFragment()
        {
            TestLabelLocator tll = new TestLabelLocator();

            tll.AddLabel( "en", "role1", "aaa" );
            tll.AddLabel( "en", "role2", "bbb" );
            tll.AddLabel( "en", "role3", "ccc" );

            tll.AddLabel( "foo", "role1", "zzz" );
            tll.AddLabel( "foo", "role2", "yyy" );
            tll.AddLabel( "foo", "role3", "xxx" );

            StringBuilder xml = new StringBuilder();

            tll.WriteXmlFragment( "en", xml );

            Assert.AreEqual( " lang=\"en\" role1=\"aaa\" role2=\"bbb\" role3=\"ccc\"", xml.ToString() );

            xml.Remove( 0, xml.Length );

            tll.WriteXmlFragment( "foo", xml );
            Assert.AreEqual( " lang=\"foo\" role1=\"zzz\" role2=\"yyy\" role3=\"xxx\"", xml.ToString() );
        }
Beispiel #2
0
        public void Test_XmlFragment()
        {
            TestLabelLocator tll = new TestLabelLocator();

            tll.AddLabel("en", "role1", "aaa");
            tll.AddLabel("en", "role2", "bbb");
            tll.AddLabel("en", "role3", "ccc");

            tll.AddLabel("foo", "role1", "zzz");
            tll.AddLabel("foo", "role2", "yyy");
            tll.AddLabel("foo", "role3", "xxx");


            StringBuilder xml = new StringBuilder();

            tll.WriteXmlFragment("en", xml);

            Assert.AreEqual(" lang=\"en\" role1=\"aaa\" role2=\"bbb\" role3=\"ccc\"", xml.ToString());

            xml.Remove(0, xml.Length);

            tll.WriteXmlFragment("foo", xml);
            Assert.AreEqual(" lang=\"foo\" role1=\"zzz\" role2=\"yyy\" role3=\"xxx\"", xml.ToString());
        }