public void VerifyMessageBodyWithOneOf(string oneOfName, FieldTupleType[] fieldTuples , OptionIdentifierPath[] optionNames, IVariant[] optionValues) { Assert.NotNull(fieldTuples); Assert.NotEmpty(fieldTuples); IEnumerable <IOneOfBodyItem> GetOneOfBodyItems() { foreach (var(protoType, fieldName, fieldNumber) in fieldTuples) { yield return(new OneOfFieldStatement { // TODO: TBD: may further generalize this in the test cases themselves... FieldType = Variant.Create(protoType), Name = fieldName, Number = fieldNumber, Options = ElaborateOptions <FieldOption>(optionNames, optionValues).ToList() }); } } ExpectedBody.Add(new OneOfStatement { Name = oneOfName, Items = GetOneOfBodyItems().ToList() }); }
public void VerifyMessageBodyWithEmptyGroupField(LabelKind label, string groupName, long fieldNumber) { ExpectedBody.Add( new GroupFieldStatement { Label = label, Name = groupName, Number = fieldNumber } ); }
public void VerifyMessageBodyWithEmptyOneOf(string oneOfName) { ExpectedBody.Add(new OneOfStatement { Name = oneOfName, Items = GetRange <IOneOfBodyItem>(NewEmptyStatement).ToList() }); }
public void VerifyMessageBodyWithFieldNamesReserved(Identifier[] fieldNames) { Assert.NotNull(fieldNames); Assert.NotEmpty(fieldNames); ExpectedBody.Add(new FieldNamesReservedStatement { Items = fieldNames.ToList() }); }
public virtual void VerifyMessageBodyWithNormalField(LabelKind label, IVariant fieldType, string fieldName , long fieldNumber) { ExpectedBody.Add(new NormalFieldStatement { Label = label, FieldType = fieldType, Name = fieldName, Number = fieldNumber }); }
public void VerifyMessageBodyWithMapField(KeyType keyType, IVariant valueType, string mapName, long fieldNumber , OptionIdentifierPath[] optionNames, IVariant[] optionValues) { ExpectedBody.Add(new MapFieldStatement { KeyType = keyType, ValueType = valueType, Name = mapName, Number = fieldNumber, Options = ElaborateOptions <FieldOption>(optionNames, optionValues).ToList() }); }
public void VerifyMessageBodyWithRangesReserved(Tuple <long, long?>[] ranges) { ExpectedBody.Add(new RangesReservedStatement { Items = ranges.ToRangeDescriptors().ToList() }); }
public void VerifyMessageBodyWithExtensions(Tuple <long, long?>[] ranges) { ExpectedBody.Add(new ExtensionsStatement { Items = ranges.ToRangeDescriptors().ToList() }); }
public void VerifyMessageBodyWithEmptyMessage(string innerMessageName) { ExpectedBody.Add(new MessageStatement { Name = innerMessageName }); }
public void VerifyMessageBodyWithEmptyEnum(string enumName) { ExpectedBody.Add(new EnumStatement { Name = enumName }); }