本文整理汇总了C#中QuickFix.DataDictionary.DataDictionary.Load方法的典型用法代码示例。如果您正苦于以下问题:C# QuickFix.DataDictionary.DataDictionary.Load方法的具体用法?C# QuickFix.DataDictionary.DataDictionary.Load怎么用?C# QuickFix.DataDictionary.DataDictionary.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuickFix.DataDictionary.DataDictionary
的用法示例。
在下文中一共展示了QuickFix.DataDictionary.DataDictionary.Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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"));
}
示例2: 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"]);
}
示例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));
}
示例4: 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));
}
示例5: 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());
}
示例6: 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));
}
示例7: 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));
}
示例8: 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"));
}
示例9: 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);
}
示例10: RepeatingGroup_ReuseObject
public void RepeatingGroup_ReuseObject()
{
QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
dd.Load("../../../spec/fix/FIX42.xml");
QuickFix.FIX42.News news = new QuickFix.FIX42.News(new QuickFix.Fields.Headline("Foo headline"));
QuickFix.FIX42.News.LinesOfTextGroup group = new QuickFix.FIX42.News.LinesOfTextGroup();
group.Text = new QuickFix.Fields.Text("line1");
news.AddGroup(group);
group.Text = new QuickFix.Fields.Text("line2");
news.AddGroup(group);
string raw = news.ToString();
string nul = "\x01";
StringAssert.Contains(
nul + "33=2" + nul + "58=line1" + nul + "58=line2",
raw);
}
示例11: BasicMessageTest
public void BasicMessageTest()
{
QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
dd.Load("../../../spec/fix/FIX44.xml");
Assert.That(dd.Messages["3"].Fields.Count, Is.EqualTo(7));
}
示例12: DuplicateEnumsDoesNotThrow
public void DuplicateEnumsDoesNotThrow()
{
// If this test throws, it failed.
QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
dd.Load("../../../spec/test/FIX43_dup_enum.xml");
}
示例13: NestedGroupTest
public void NestedGroupTest()
{
QuickFix.DataDictionary.DataDictionary dd = new QuickFix.DataDictionary.DataDictionary();
dd.Load("../../../spec/fix/FIX44.xml");
QuickFix.DataDictionary.DDMap msgJ = dd.Messages["J"];
Assert.True(msgJ.IsGroup(73));
Assert.False(msgJ.IsGroup(756));
Assert.True(msgJ.GetGroup(73).IsGroup(756));
}
示例14: issue56_GetGroup_type1
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);
}
示例15: issue95
public void issue95()
{
// Parser screws up on triple-nested groups. Contributes to ResendRequest failures.
string msgStr = String.Join(Message.SOH, new string[]{
"8=FIX.4.4","9=999","35=R","34=6","49=sendercompid","52=20130225-10:44:59.149","56=targetcompid", //headers
"131=quotereqid",
"146=1", // NoRelatedSym
"55=ABC","65=CD","48=securityid","22=1", // group
"711=1", // NoUnderlyings
"311=underlyingsymbol","312=WI","309=underlyingsecurityid","305=1",
"10=999",""
});
var dd = new QuickFix.DataDictionary.DataDictionary();
dd.Load("../../../spec/fix/FIX44.xml");
Message msg = new Message();
msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);
// make sure no fields were dropped in parsing
Assert.AreEqual(msgStr.Length, msg.ToString().Length);
// make sure repeating groups are not rearranged
// 1 level deep
StringAssert.Contains(String.Join(Message.SOH, new string[] { "55=ABC", "65=CD", "48=securityid", "22=1" }), msg.ToString());
// 2 levels deep
StringAssert.Contains(String.Join(Message.SOH, new string[] { "311=underlyingsymbol", "312=WI", "309=underlyingsecurityid", "305=1" }), msg.ToString());
}