当前位置: 首页>>代码示例>>C#>>正文


C# DataDictionary.DataDictionary类代码示例

本文整理汇总了C#中QuickFix.DataDictionary.DataDictionary的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.DataDictionary.DataDictionary类的具体用法?C# QuickFix.DataDictionary.DataDictionary怎么用?C# QuickFix.DataDictionary.DataDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QuickFix.DataDictionary.DataDictionary类属于命名空间,在下文中一共展示了QuickFix.DataDictionary.DataDictionary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Send

        public bool Send(string msgStr)
        {
            QuickFix.Fields.MsgType msgType = QuickFix.Message.IdentifyType(msgStr);
            string beginString = QuickFix.Message.ExtractBeginString(msgStr);

            QuickFix.Message message = messageFactory.Create(beginString, msgType.Obj);
            QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
            message.FromString(msgStr, false, dd, dd, _defaultMsgFactory);

            if (!msgLookup.ContainsKey(msgType.getValue()))
                msgLookup.Add(msgType.getValue(), new Queue<QuickFix.Message>());

            msgLookup[msgType.getValue()].Enqueue(message);

            QuickFix.Fields.PossDupFlag possDup = new QuickFix.Fields.PossDupFlag(false);
            if (message.Header.IsSetField(possDup))
                message.Header.GetField(possDup);

            if (possDup.getValue() && msgType.getValue()!= QuickFix.Fields.MsgType.SEQUENCE_RESET)
            {
                dups.Enqueue(message);
            }

            return true;
        }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:25,代码来源:SessionTest.cs

示例2: FixMessageVisualizer

        public FixMessageVisualizer(string message, IFixDictionarySource source)
        {
            QuickFix.DataDictionary.DataDictionary dict = new QuickFix.DataDictionary.DataDictionary();

            _message = message;

            _dicSource = source;
        }
开发者ID:unclepaul84,项目名称:fixmessagevisualizer,代码行数:8,代码来源:FixMessageVisualizer.cs

示例3: ComponentSmokeTest

 public void ComponentSmokeTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
     dd.Load("../../../spec/fix/FIX44.xml");
     QuickFix.DataDictionary.DDMap tcr = dd.Messages["AE"];
     Assert.True(tcr.Fields.ContainsKey(55));
     Assert.False(tcr.Fields.ContainsKey(5995));
 }
开发者ID:shanetrotter,项目名称:quickfixn,代码行数:8,代码来源:DataDictionaryTests.cs

示例4: FieldHasDescriptionTest

 public void FieldHasDescriptionTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
     dd.Load("../../../spec/fix/FIX44.xml");
     Assert.AreEqual(typeof (Dictionary<string, string>), dd.FieldsByTag[945].EnumDict.GetType());
     Assert.That("COMPLETED", Is.EqualTo(dd.FieldsByTag[945].EnumDict["2"]));
     Assert.AreNotEqual("HEARTBEAT", dd.FieldsByTag[35].EnumDict["A"]);
 }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:8,代码来源:DataDictionaryTests.cs

示例5: VersionTest

 public void VersionTest()
 {
     QuickFix.DataDictionary.DataDictionary dd44 = new QuickFix.DataDictionary.DataDictionary();
     dd44.Load("../../../spec/fix/FIX44.xml");
     Assert.That(dd44.MajorVersion, Is.EqualTo("4"));
     Assert.That(dd44.MinorVersion, Is.EqualTo("4"));
     Assert.That(dd44.Version, Is.EqualTo("FIX.4.4"));
 }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:8,代码来源:DataDictionaryTests.cs

示例6: FieldHasValueTest

 public void FieldHasValueTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
     dd.Load("../../../spec/fix/FIX44.xml");
     Assert.That(dd.FieldHasValue(QuickFix.Fields.Tags.StatusValue, "1"), Is.EqualTo(true));
     Assert.That(dd.FieldHasValue(QuickFix.Fields.Tags.StatusValue, "CONNECTED"), Is.EqualTo(false));
     Assert.False(dd.FieldsByTag[1].HasEnums());
     Assert.True(dd.FieldsByTag[945].HasEnums());
 }
开发者ID:shanetrotter,项目名称:quickfixn,代码行数:9,代码来源:DataDictionaryTests.cs

示例7: LoadFieldsTest

 public void LoadFieldsTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
     dd.Load("../../../spec/fix/FIX44.xml");
     Assert.That(dd.FieldsByTag[1].Name, Is.EqualTo("Account"));
     Assert.That(dd.FieldsByName["Account"].Tag, Is.EqualTo(1));
     Assert.That(dd.FieldsByTag[1].EnumDict.Count, Is.EqualTo(0));
     Assert.That(dd.FieldsByTag[QuickFix.Fields.Tags.StatusValue].EnumDict.Count, Is.EqualTo(4));
 }
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:9,代码来源:DataDictionaryTests.cs

示例8: HeaderGroupTest

 public void HeaderGroupTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
     dd.Load("../../../spec/fix/FIX44.xml");
     QuickFix.DataDictionary.DDMap headerMap = dd.Header;
     Assert.True(headerMap.IsGroup(627));
     QuickFix.DataDictionary.DDGrp grpMap = headerMap.GetGroup(627);
     Assert.True(dd.Header.GetGroup(627).IsField(628));
     Assert.True(grpMap.IsField(628));
 }
开发者ID:kennystone,项目名称:quickfixn,代码行数:10,代码来源:DataDictionaryTests.cs

示例9: LoadFieldsFromStreamTest

		public void LoadFieldsFromStreamTest()
		{
			QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
			Stream stream = new FileStream("../../../spec/fix/FIX44.xml", FileMode.Open, FileAccess.Read);
			dd.Load(stream);
			Assert.That(dd.FieldsByTag[1].Name, Is.EqualTo("Account"));
			Assert.That(dd.FieldsByName["Account"].Tag, Is.EqualTo(1));
			Assert.That(dd.FieldsByTag[1].EnumDict.Count, Is.EqualTo(0));
			Assert.That(dd.FieldsByTag[QuickFix.Fields.Tags.StatusValue].EnumDict.Count, Is.EqualTo(4));
		}
开发者ID:RemiGaudin,项目名称:quickfixn,代码行数:10,代码来源:DataDictionaryTests.cs

示例10: CheckIsInGroupTest

        public void CheckIsInGroupTest()
        {
            QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/fix/FIX44.xml");
            QuickFix.DataDictionary.DDGrp g = dd.Messages["B"].GetGroup(33);

            QuickFix.Fields.Text textField = new QuickFix.Fields.Text("woot");
            QuickFix.Fields.ClOrdID clOrdIdField = new QuickFix.Fields.ClOrdID("not woot");

            Assert.DoesNotThrow(delegate() { dd.CheckIsInGroup(textField, g, "B"); });
            Assert.Throws(typeof(TagNotDefinedForMessage), delegate { dd.CheckIsInGroup(clOrdIdField, g, "B"); });
        }
开发者ID:Gelber,项目名称:quickfixn,代码行数:11,代码来源:DataDictionaryTests.cs

示例11: GroupTest

 public void GroupTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
     dd.Load("../../../spec/fix/FIX44.xml");
     QuickFix.DataDictionary.DDMap tcrr = dd.Messages["AD"];
     Assert.True(tcrr.IsGroup(711));
     Assert.True(tcrr.IsField(711));  // No Field also a field
     Assert.True(tcrr.GetGroup(711).IsField(311));
     Assert.That(tcrr.Groups[711].Fields[311].Name, Is.EqualTo("UnderlyingSymbol"));
     Assert.That(tcrr.Groups[711].Delim, Is.EqualTo(311));
     QuickFix.DataDictionary.DDMap tcr = dd.Messages["AE"];
     Assert.That(tcr.Groups[711].Groups[457].Fields[458].Name, Is.EqualTo("UnderlyingSecurityAltID"));
 }
开发者ID:shanetrotter,项目名称:quickfixn,代码行数:13,代码来源:DataDictionaryTests.cs

示例12: CheckGroupCountTest

        public void CheckGroupCountTest()
        {
            QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/fix/FIX42.xml");

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

            string nul = Message.SOH;
            string s = "8=FIX.4.2" + nul + "9=148" + nul + "35=D" + nul + "34=2" + nul + "49=TW" + nul + "52=20111011-15:06:23.103" + nul + "56=ISLD" + nul
                + "11=ID" + nul + "21=1" + nul + "40=1" + nul + "54=1" + nul + "38=200.00" + nul + "55=INTC" + nul
                + "386=3" + nul + "336=PRE-OPEN" + nul + "336=AFTER-HOURS" + nul
                + "60=20111011-15:06:23.103" + nul
                + "10=35" + nul;

            n.FromString(s, true, dd, dd);

            //verify that FromString didn't correct the counter (if these fail, check if MessageTests::FromString_DoNotCorrectCounter() passes)
            Assert.AreEqual("386=3", n.NoTradingSessions.toStringField());
            StringAssert.Contains("386=3", n.ToString());

            Assert.Throws<QuickFix.RepeatingGroupCountMismatch>(delegate { dd.CheckGroupCount(n.NoTradingSessions, n, "D"); });
        }
开发者ID:shanetrotter,项目名称:quickfixn,代码行数:21,代码来源:DataDictionaryTests.cs

示例13: DateOnlyTimeOnlyConvertProblem

        public void DateOnlyTimeOnlyConvertProblem()
        {
            // issue 135

            var dd = new QuickFix.DataDictionary.DataDictionary();
            dd.Load("../../../spec/fix/FIX44.xml");

            string[] msgFields = { "8=FIX.4.4", "9=332", "35=W", "34=2", "49=MA", "52=20121024-12:21:42.170", "56=xxxx",
                "22=4", "48=BE0932900518", "55=[N/A]", "262=1b145288-9c9a-4911-a084-7341c69d3e6b", "762=EURO_EUR", "268=2",
                "269=0", "270=97.625", "15=EUR", "271=1246000", "272=20121024", "273=07:30:47", "276=I", "282=BEARGB21XXX", "299=15478575",
                "269=1", "270=108.08", "15=EUR", "271=884000", "272=20121024", "273=07:30:47", "276=I", "282=BEARGB21XXX", "299=15467902", "10=77"
            };
            string msgStr = String.Join(Message.SOH, msgFields) + Message.SOH;

            QuickFix.FIX44.MarketDataSnapshotFullRefresh msg = new QuickFix.FIX44.MarketDataSnapshotFullRefresh();

            msg.FromString(msgStr, true, dd, dd, _defaultMsgFactory);
            QuickFix.FIX44.MarketDataIncrementalRefresh.NoMDEntriesGroup gentry1 = (QuickFix.FIX44.MarketDataIncrementalRefresh.NoMDEntriesGroup)msg.GetGroup(1, new QuickFix.FIX44.MarketDataIncrementalRefresh.NoMDEntriesGroup());
            Assert.AreEqual(new DateTime(2012, 10, 24), gentry1.MDEntryDate.getValue());
            Assert.AreEqual(new DateTime(2012, 10, 24, 7, 30, 47).TimeOfDay, gentry1.MDEntryTime.getValue().TimeOfDay);
            Assert.AreEqual(new DateTime(2012, 10, 24, 7, 30, 47), gentry1.MDEntryDate.getValue() + gentry1.MDEntryTime.getValue().TimeOfDay);
        }
开发者ID:BuddyWork,项目名称:quickfixn,代码行数:22,代码来源:MessageTests.cs

示例14: CheckValidTagTest

 public void CheckValidTagTest()
 {
     QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/fix/FIX44.xml");
     Assert.Throws(typeof(InvalidTagNumber),
         delegate { dd.CheckValidTagNumber(999); });
 }
开发者ID:shanetrotter,项目名称:quickfixn,代码行数:6,代码来源:DataDictionaryTests.cs

示例15: Issue134_RequiredIsOptional

        public void Issue134_RequiredIsOptional()
        {
            QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary("../../../spec/test/required_is_optional.xml");
            Assert.True(dd.Messages["magic"].ReqFields.Contains(1111));  //base required field
            Assert.False(dd.Messages["magic"].ReqFields.Contains(5555)); //base optional field
            Assert.False(dd.Messages["magic"].ReqFields.Contains(5556)); //component optional field

            Assert.False(dd.Messages["magic"].Groups[6660].Required); // group isn't required
            Assert.False(dd.Messages["magic"].Groups[6660].ReqFields.Contains(6662)); // group optional field
        }
开发者ID:Gelber,项目名称:quickfixn,代码行数:10,代码来源:DataDictionaryTests.cs


注:本文中的QuickFix.DataDictionary.DataDictionary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。