本文整理汇总了C#中FieldMap.GetInt方法的典型用法代码示例。如果您正苦于以下问题:C# FieldMap.GetInt方法的具体用法?C# FieldMap.GetInt怎么用?C# FieldMap.GetInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FieldMap
的用法示例。
在下文中一共展示了FieldMap.GetInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckGroupCount
/// <summary>
/// If <paramref name="field"/> is a group-counter for <paramref name="msgType"/>, check that it is accurate, else do nothing.
/// </summary>
/// <param name="field">a group's counter field</param>
/// <param name="map">the FieldMap that contains the group being checked</param>
/// <param name="msgType">msg type of message that is/contains <paramref name="map"/></param>
public void CheckGroupCount(Fields.IField field, FieldMap map, string msgType)
{
if(IsGroup(msgType, field.Tag))
{
if (map.GetInt(field.Tag) != map.GroupCount(field.Tag))
{
throw new RepeatingGroupCountMismatch(field.Tag);
}
}
}
示例2: GroupDelimTest
public void GroupDelimTest()
{
Group g1 = new Group(100, 200);
Assert.AreEqual(100, g1.Field); //counter
Assert.AreEqual(200, g1.Delim);
g1.SetField(new StringField(200, "delim!"));
FieldMap fm = new FieldMap();
fm.AddGroup(g1);
Assert.AreEqual(1, fm.GetInt(100));
Group g2 = new Group(100, 200);
g2.SetField(new StringField(200, "again!"));
fm.AddGroup(g2);
Assert.AreEqual(2, fm.GetInt(100));
}