Ejemplo n.º 1
0
        public void TestDeltas()
        {
            var templateSource = new StreamReader("CME/templates.xml");
            var templateLoader = new XMLMessageTemplateLoader {LoadTemplateIdFromAuxId = true};
            templateLoader.Load(templateSource.BaseStream);

            var is1 = new StreamReader("CME/messages.fast");
            var mis = new MessageInputStream(is1.BaseStream);
            mis.SetTemplateRegistry(templateLoader.TemplateRegistry);
            Message md = mis.ReadMessage();
            Assert.AreEqual(-5025.0, md.GetSequence("MDEntries")[0].GetDouble("NetChgPrevDay"), .1);
        }
 protected static MessageTemplate Template(String templateXml)
 {
     MessageTemplate[] templates = new XMLMessageTemplateLoader().Load
     (new MemoryStream(System.Text.Encoding.ASCII.GetBytes(templateXml)));
     return templates[0];
 }