Esempio n. 1
0
        public void IsAdmin_IsApp()
        {
            // issue 173
            var dd = new QuickFix.DataDictionary.DataDictionary();

            dd.Load("../../../spec/fix/FIX42.xml");

            string[] newsFields = { "8=FIX4.2", "9=5", "35=B", "10=133" };
            string   newsStr    = String.Join(Message.SOH, newsFields) + Message.SOH;

            QuickFix.FIX42.News news = new QuickFix.FIX42.News();
            news.FromString(newsStr, true, dd, dd, _defaultMsgFactory);

            string[] hbFields = { "8=FIX.4.2", "9=16", "35=0", "34=3", "49=TW", "10=1" };
            string   hbStr    = String.Join(Message.SOH, hbFields) + Message.SOH;

            QuickFix.FIX42.Heartbeat heartbeat = new QuickFix.FIX42.Heartbeat();
            heartbeat.FromString(hbStr, true, dd, dd, _defaultMsgFactory);

            Assert.False(news.IsAdmin());
            //Assert.True(news.IsApp());

            //Assert.True(heartbeat.IsAdmin());
            Assert.False(heartbeat.IsApp());
        }
Esempio n. 2
0
        public void issue56_GetGroup_type2()
        {
            // boring message construction stuff
            var dd = new QuickFix.DataDictionary.DataDictionary();

            dd.Load("../../../spec/fix/FIX44.xml");
            string[] msgFields = { "8=FIX.4.2", "9=87", "35=B", "34=3", "49=CLIENT1", "52=20111012-22:15:55.474", "56=EXECUTOR", "148=AAAAAAA", "33=2", "58=L1", "58=L2", "10=016" };
            string   msgStr    = String.Join(Message.SOH, msgFields) + Message.SOH;

            QuickFix.FIX42.News msg = new QuickFix.FIX42.News();
            msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);
            Assert.AreEqual(2, msg.GroupCount(Tags.LinesOfText)); // for sanity

            // the test
            QuickFix.FIX42.News.LinesOfTextGroup grp = new QuickFix.FIX42.News.LinesOfTextGroup(); // for return value

            var rv1 = msg.GetGroup(1, grp);

            Assert.AreSame(rv1, grp);
            Assert.IsInstanceOf <QuickFix.FIX42.News.LinesOfTextGroup>(rv1);
            Assert.AreEqual("L1", grp.Text.Obj);

            var rv2 = msg.GetGroup(2, grp);

            Assert.AreSame(rv2, grp);
            Assert.IsInstanceOf <QuickFix.FIX42.News.LinesOfTextGroup>(rv2);
            Assert.AreEqual("L2", grp.Text.Obj);
        }
Esempio n. 3
0
        public void FromString_GroupDelimiterIssue()
        {
            // 349
            QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
            dd.LoadFIXSpec("FIX42");

            QuickFix.FIX42.News n = new QuickFix.FIX42.News();

            string s = String.Join(Message.SOH, new string[] {
                "8=FIX.4.2", "9=91", "35=B", "34=2", "49=TW", "52=20111011-15:06:23.103", "56=ISLD",
                "148=headline", "33=3",
                "58=line1", "354=3", "355=uno", // first group, has delimiter
                "354=3", "355=dos",             // second group, missing delimiter
                "354=4", "355=tres",            // third group, also missing delimiter
                "10=193"
            }) + Message.SOH;

            Assert.Throws <RepeatedTagWithoutGroupDelimiterTagException>(delegate { n.FromString(s, true, dd, dd, _defaultMsgFactory); });
        }
Esempio n. 4
0
        public void issue56_GetGroup_by_reference()
        {
            // setup
            var dd = new QuickFix.DataDictionary.DataDictionary();

            dd.LoadFIXSpec("FIX44");
            string[] msgFields = { "8=FIX.4.2", "9=87", "35=B", "34=3", "49=CLIENT1", "52=20111012-22:15:55.474", "56=EXECUTOR", "148=AAAAAAA", "33=2", "58=L1", "58=L2", "10=016" };
            string   msgStr    = String.Join(Message.SOH, msgFields) + Message.SOH;

            QuickFix.FIX42.News msg = new QuickFix.FIX42.News();
            msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);
            Assert.AreEqual(2, msg.GroupCount(Tags.LinesOfText)); // for sanity

            // the test
            QuickFix.FIX42.News.LinesOfTextGroup grp = new QuickFix.FIX42.News.LinesOfTextGroup(); // for return value

            msg.GetGroup(1, grp);
            Assert.AreEqual("L1", grp.Text.Obj);

            msg.GetGroup(2, grp);
            Assert.AreEqual("L2", grp.Text.Obj);
        }
Esempio n. 5
0
        public void issue56_GetGroup_by_tag_and_return()
        {
            // setup
            var dd = new QuickFix.DataDictionary.DataDictionary();

            dd.Load("../../../spec/fix/FIX44.xml");
            string[] msgFields = { "8=FIX.4.2", "9=87", "35=B", "34=3", "49=CLIENT1", "52=20111012-22:15:55.474", "56=EXECUTOR", "148=AAAAAAA", "33=2", "58=L1", "58=L2", "10=016" };
            string   msgStr    = String.Join(Message.SOH, msgFields) + Message.SOH;

            QuickFix.FIX42.News msg = new QuickFix.FIX42.News();
            msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);
            Assert.AreEqual(2, msg.GroupCount(Tags.LinesOfText)); // for sanity

            // the test
            var grp1 = msg.GetGroup(1, Tags.LinesOfText);

            Assert.IsInstanceOf <QuickFix.FIX42.News.LinesOfTextGroup>(grp1);
            Assert.AreEqual("L1", (grp1 as QuickFix.FIX42.News.LinesOfTextGroup).Text.Obj);

            var grp2 = msg.GetGroup(2, Tags.LinesOfText);

            Assert.IsInstanceOf <QuickFix.FIX42.News.LinesOfTextGroup>(grp2);
            Assert.AreEqual("L2", (grp2 as QuickFix.FIX42.News.LinesOfTextGroup).Text.Obj);
        }
Esempio n. 6
0
        public void IsAdmin_IsApp()
        {
            // issue 173
            var dd = new QuickFix.DataDictionary.DataDictionary();
            dd.Load("../../../spec/fix/FIX42.xml");

            string[] newsFields = { "8=FIX4.2", "9=5", "35=B", "10=133" };
            string newsStr = String.Join(Message.SOH, newsFields) + Message.SOH;
            QuickFix.FIX42.News news = new QuickFix.FIX42.News();
            news.FromString(newsStr, true, dd, dd, _defaultMsgFactory);

            string[] hbFields = { "8=FIX.4.2", "9=16", "35=0", "34=3", "49=TW", "10=1" };
            string hbStr = String.Join(Message.SOH, hbFields) + Message.SOH;
            QuickFix.FIX42.Heartbeat heartbeat = new QuickFix.FIX42.Heartbeat();
            heartbeat.FromString(hbStr, true, dd, dd, _defaultMsgFactory);

            Assert.False(news.IsAdmin());
            //Assert.True(news.IsApp());

            //Assert.True(heartbeat.IsAdmin());
            Assert.False(heartbeat.IsApp());
        }
Esempio n. 7
0
        public void issue56_GetGroup_by_reference()
        {
            // setup
            var dd = new QuickFix.DataDictionary.DataDictionary();
            dd.Load("../../../spec/fix/FIX44.xml");
            string[] msgFields = { "8=FIX.4.2", "9=87", "35=B", "34=3", "49=CLIENT1", "52=20111012-22:15:55.474", "56=EXECUTOR", "148=AAAAAAA", "33=2", "58=L1", "58=L2", "10=016" };
            string msgStr = String.Join(Message.SOH, msgFields) + Message.SOH;
            QuickFix.FIX42.News msg = new QuickFix.FIX42.News();
            msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);
            Assert.AreEqual(2, msg.GroupCount(Tags.LinesOfText)); // for sanity

            // the test
            QuickFix.FIX42.News.LinesOfTextGroup grp = new QuickFix.FIX42.News.LinesOfTextGroup(); // for return value

            msg.GetGroup(1, grp);
            Assert.AreEqual("L1", grp.Text.Obj);

            msg.GetGroup(2, grp);
            Assert.AreEqual("L2", grp.Text.Obj);
        }
Esempio n. 8
0
        public void issue56_GetGroup_type1()
        {
            // boring message construction stuff
            var dd = new QuickFix.DataDictionary.DataDictionary();
            dd.Load("../../../spec/fix/FIX44.xml");
            string[] msgFields = { "8=FIX.4.2", "9=87", "35=B", "34=3", "49=CLIENT1", "52=20111012-22:15:55.474", "56=EXECUTOR", "148=AAAAAAA", "33=2", "58=L1", "58=L2", "10=016" };
            string msgStr = String.Join(Message.SOH, msgFields) + Message.SOH;
            QuickFix.FIX42.News msg = new QuickFix.FIX42.News();
            msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);
            Assert.AreEqual(2, msg.GroupCount(Tags.LinesOfText)); // for sanity

            // the test
            var grp1 = msg.GetGroup(1, Tags.LinesOfText);
            Assert.IsInstanceOf<QuickFix.FIX42.News.LinesOfTextGroup>(grp1);
            Assert.AreEqual("L1", (grp1 as QuickFix.FIX42.News.LinesOfTextGroup).Text.Obj);

            var grp2 = msg.GetGroup(2, Tags.LinesOfText);
            Assert.IsInstanceOf<QuickFix.FIX42.News.LinesOfTextGroup>(grp2);
            Assert.AreEqual("L2", (grp2 as QuickFix.FIX42.News.LinesOfTextGroup).Text.Obj);
        }