public void GetOpeningWithoutChildren_NoChildren() { var origin = "<Foo Bar=\"123\"></Foo>"; var expected = "<Foo Bar=\"123\">"; var actual = XamlElementProcessor.GetOpeningWithoutChildren(origin); Assert.AreEqual(expected, actual); }
public void GetOpeningWithoutChildren_SelfClosing() { var origin = "<Foo Bar=\"123\" />"; var expected = origin; var actual = XamlElementProcessor.GetOpeningWithoutChildren(origin); Assert.AreEqual(expected, actual); }
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); }
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); }