Skip to content

Commit

Permalink
test to confirm issue connamara#179
Browse files Browse the repository at this point in the history
  • Loading branch information
gbirchmeier committed May 15, 2013
1 parent 3ead7e4 commit 2662a0f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
3 changes: 2 additions & 1 deletion QuickFIXn/Message/FieldMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ internal void AddGroup(Group grp, bool autoIncCounter)
}

/// <summary>
/// Gets an instance of a group
/// Gets an instance of a group. Note: use GetGroup(int,Group) if you want
/// your group as the proper subtype (e.g. NoPartyIDsGroup instead of the generic Group)
/// </summary>
/// <param name="num">index of desired group (starting at 1)</param>
/// <param name="field">counter tag of repeating group</param>
Expand Down
38 changes: 38 additions & 0 deletions UnitTests/MessageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -801,5 +801,43 @@ public void MessageHasDecimalWithNoLeadingZero()

Assert.AreEqual(0.23, msg.Factor.getValue());
}

[Test]
public void FromString_Groups_NoFactory()
{
// issue 179
var dd = new QuickFix.DataDictionary.DataDictionary();
dd.Load("../../../spec/fix/FIX44.xml");

string[] msgFields = {
// header
"8=FIX.4.4","9=638", "35=8", "34=360", "49=BLPTSOX", "52=20130321-15:21:23", "56=THINKTSOX", "57=6804469", "128=ZERO",
// non-group body fields
"6=122.255", "11=61101189", "14=1990000", "15=GBP", "17=VCON:20130321:50018:5:12", "22=4", "31=122.255", "32=1990000",
"37=116", "38=1990000", "39=2", "48=GB0032452392", "54=1", "55=[N/A]", "60=20130321-15:21:23", "64=20130322", "75=20130321",
"106=UK TSY 4 1/4% 2036", "118=2436321.85", "150=F", "151=0", "157=15", "159=3447.35", "192=0", "198=3739:20130321:50018:5",
"223=0.0425", "228=1", "236=0.0291371041", "238=0", "381=2432874.5", "423=1", "470=GB", "541=20360307",
// NoPartyIDs
"453=6",
"448=VCON", "447=D", "452=1", "802=1", "523=14", "803=4",
"448=TFOLIO:6804469", "447=D", "452=12",
"448=TFOLIO", "447=D", "452=11",
"448=THINKFOLIO LTD", "447=D", "452=13",
"448=SXT", "447=D", "452=16",
"448=TFOLIO:6804469", "447=D", "452=36",
"10=152"
};
string msgStr = String.Join(Message.SOH, msgFields) + Message.SOH;

QuickFix.FIX44.ExecutionReport msg = new QuickFix.FIX44.ExecutionReport();
msg.FromString(msgStr, true, dd, dd, null); // <-- null factory!

Console.WriteLine(msg.ToString());

QuickFix.FIX44.ExecutionReport.NoPartyIDsGroup partyGroup = new QuickFix.FIX44.ExecutionReport.NoPartyIDsGroup();
msg.GetGroup(2, partyGroup);

Assert.False(partyGroup.IsSetNoPartySubIDs());
}
}
}

0 comments on commit 2662a0f

Please sign in to comment.