Skip to content

Commit

Permalink
Merge pull request #912 from gbirchmeier/fix-fieldmap-tests
Browse files Browse the repository at this point in the history
FieldMapTests: fix a few tests, then remove pointless private var
  • Loading branch information
mgatny authored Dec 20, 2024
2 parents 676dfec + bc16384 commit dc3614d
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 121 deletions.
16 changes: 8 additions & 8 deletions QuickFIXn/Message/FieldMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,19 @@ internal void AddGroup(Group grp, bool autoIncCounter)
/// 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>
/// <param name="counterTag">counter tag of repeating group</param>
/// <returns>retrieved group object</returns>
/// <exception cref="FieldNotFoundException" />
public Group GetGroup(int num, int field)
public Group GetGroup(int num, int counterTag)
{
if (!_groups.ContainsKey(field))
throw new FieldNotFoundException(field);
if (!_groups.ContainsKey(counterTag))
throw new FieldNotFoundException(counterTag);
if (num <= 0)
throw new FieldNotFoundException(field);
if (_groups[field].Count < num)
throw new FieldNotFoundException(field);
throw new FieldNotFoundException(counterTag);
if (_groups[counterTag].Count < num)
throw new FieldNotFoundException(counterTag);

return _groups[field][num - 1];
return _groups[counterTag][num - 1];
}

/// <summary>
Expand Down
Loading

0 comments on commit dc3614d

Please sign in to comment.