Exemplo n.º 1
0
        public void AttributesAndSubElements()
        {
            string xml = "<msg><name type=\"surname\"><value>Smith</value></name></msg>";

            var reader = new FudgeXmlStreamReader(context, xml);
            var msg = reader.ReadMsg();

            Assert.Equal(FudgeMsgFieldType.Instance, msg.GetByName("name").Type);
            var name = msg.GetMessage("name");
            Assert.Equal("surname", name.GetString("type"));
            Assert.Equal("Smith", name.GetString("value"));
        }
Exemplo n.º 2
0
        public void AttributesAndText()
        {
            // Value should go into a field with empty name
            // REVIEW 2009-12-17 t0rx -- Is this a good thing to do, or should it go in a field called "value", or just be ignored?
            string xml = "<msg><name type=\"surname\">Smith</name></msg>";

            var reader = new FudgeXmlStreamReader(context, xml);
            var msg = reader.ReadMsg();

            Assert.Equal(FudgeMsgFieldType.Instance, msg.GetByName("name").Type);
            var name = msg.GetMessage("name");
            Assert.Equal("surname", name.GetString("type"));
            Assert.Equal("Smith", name.GetString(""));
        }