예제 #1
0
        public void TestGetCenterLeftRightSection()
        {
            HeaderFooterHelper helper = new HeaderFooterHelper();

            String headerFooter = "&CTest the center section";

            Assert.AreEqual("Test the center section", helper.GetCenterSection(headerFooter));

            headerFooter = "&CTest the center section&LThe left one&RAnd the right one";
            Assert.AreEqual("Test the center section", helper.GetCenterSection(headerFooter));
            Assert.AreEqual("The left one", helper.GetLeftSection(headerFooter));
            Assert.AreEqual("And the right one", helper.GetRightSection(headerFooter));
        }
예제 #2
0
        public void TestSetCenterLeftRightSection()
        {
            HeaderFooterHelper helper       = new HeaderFooterHelper();
            String             headerFooter = "";

            headerFooter = helper.SetCenterSection(headerFooter, "First Added center section");
            Assert.AreEqual("First Added center section", helper.GetCenterSection(headerFooter));
            headerFooter = helper.SetLeftSection(headerFooter, "First left");
            Assert.AreEqual("First left", helper.GetLeftSection(headerFooter));

            headerFooter = helper.SetRightSection(headerFooter, "First right");
            Assert.AreEqual("First right", helper.GetRightSection(headerFooter));
            Assert.AreEqual("&CFirst Added center section&LFirst left&RFirst right", headerFooter);

            headerFooter = helper.SetRightSection(headerFooter, "First right&F");
            Assert.AreEqual("First right&F", helper.GetRightSection(headerFooter));
            Assert.AreEqual("&CFirst Added center section&LFirst left&RFirst right&F", headerFooter);

            headerFooter = helper.SetRightSection(headerFooter, "First right&");
            Assert.AreEqual("First right&", helper.GetRightSection(headerFooter));
            Assert.AreEqual("&CFirst Added center section&LFirst left&RFirst right&", headerFooter);
        }