Example #1
0
        public void TestSimpleTagWithOneAttributeAndValue()
        {
            var expected =
                "<price currency=" +
                "'" +
                "USD" +
                "'>" +
                SamplePrice +
                "</price>";

            TagNode priceTag = new TagNode("price");

            priceTag.AddAttribute("currency", "USD");
            priceTag.AddValue(SamplePrice);
            Assert.AreEqual(expected, priceTag.ToString());
        }
        public void Test_SimpleTag_WithOneAttribute_And_Value()
        {
            // Arrange
            String expected =
                "<price currency=" +
                "'" +
                "USD" +
                "'>" +
                SAMPLE_PRICE +
                "</price>";

            // Act
            TagNode priceTag = new TagNode("price");

            priceTag.AddAttribute("currency", "USD");
            priceTag.AddValue(SAMPLE_PRICE);

            // Assert
            Assert.AreEqual(expected, priceTag.ToString(), "price XML");
        }