コード例 #1
0
        public void GetOpeningWithoutChildren_NoChildren()
        {
            var origin   = "<Foo Bar=\"123\"></Foo>";
            var expected = "<Foo Bar=\"123\">";

            var actual = XamlElementProcessor.GetOpeningWithoutChildren(origin);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void GetOpeningWithoutChildren_SelfClosing()
        {
            var origin   = "<Foo Bar=\"123\" />";
            var expected = origin;

            var actual = XamlElementProcessor.GetOpeningWithoutChildren(origin);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void GetOpeningWithoutChildren_MultipleChildren_AndMultipleAttributesAsElementsWithNesting_PlusAssortedWhitespace()
        {
            var origin = "   <Foo>  <Foo.Bar=\"123\">\r\n<Other />\r<Other />\r\n\r\n</Foo.Bar>\r\n<Foo.Bar=\"123\">\r\n    <Other />\r\n    <Other  /></Foo.Bar ><Fu><Baa /></Fu><FuBar  />  </Foo>";

            var expected = "<Foo>  <Foo.Bar=\"123\">\r\n<Other />\r<Other />\r\n\r\n</Foo.Bar>\r\n<Foo.Bar=\"123\">\r\n    <Other />\r\n    <Other  /></Foo.Bar >";

            var actual = XamlElementProcessor.GetOpeningWithoutChildren(origin);

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void GetOpeningWithoutChildren_MultipleChildren_AndMultipleAttributesAsElements()
        {
            var origin = "<Foo><Foo.Bar=\"123\" /><Foo.Bar=\"123\" /><FuBar /><FuBar /></Foo>";

            var expected = "<Foo><Foo.Bar=\"123\" /><Foo.Bar=\"123\" />";

            var actual = XamlElementProcessor.GetOpeningWithoutChildren(origin);

            Assert.AreEqual(expected, actual);
        }