示例#1
0
        public void ParseDesignatorWithAttributeTest()
        {
            //Parse tokens
            MarkupParser markupParser     = new MarkupParser(Init("img@100%50"));
            Designator   parsedDesignator = markupParser.ParseDesignator();

            //Check designator
            Assert.AreEqual("img", parsedDesignator.GetIdentifier());
            Assert.AreEqual(1, parsedDesignator.GetAttributes().Count);

            //Check attribute
            Attribute parsedAttribute = (Attribute)parsedDesignator.GetAttributes().Get(0);

            Assert.AreEqual(typeof(Width_HeightAttribute), parsedAttribute.GetType());

            //Check Width_HeightAttribute contents
            Width_HeightAttribute attribute = (Width_HeightAttribute)parsedAttribute;

            Assert.AreEqual(100, attribute.GetWidth());
            Assert.AreEqual(50, attribute.GetHeight());
        }