Esempio n. 1
0
        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()
            });
        }
Esempio n. 2
0
 public void VerifyMessageBodyWithEmptyGroupField(LabelKind label, string groupName, long fieldNumber)
 {
     ExpectedBody.Add(
         new GroupFieldStatement {
         Label = label, Name = groupName, Number = fieldNumber
     }
         );
 }
Esempio n. 3
0
 public void VerifyMessageBodyWithEmptyOneOf(string oneOfName)
 {
     ExpectedBody.Add(new OneOfStatement
     {
         Name  = oneOfName,
         Items = GetRange <IOneOfBodyItem>(NewEmptyStatement).ToList()
     });
 }
Esempio n. 4
0
        public void VerifyMessageBodyWithFieldNamesReserved(Identifier[] fieldNames)
        {
            Assert.NotNull(fieldNames);
            Assert.NotEmpty(fieldNames);

            ExpectedBody.Add(new FieldNamesReservedStatement {
                Items = fieldNames.ToList()
            });
        }
Esempio n. 5
0
 public virtual void VerifyMessageBodyWithNormalField(LabelKind label, IVariant fieldType, string fieldName
                                                      , long fieldNumber)
 {
     ExpectedBody.Add(new NormalFieldStatement
     {
         Label     = label,
         FieldType = fieldType,
         Name      = fieldName,
         Number    = fieldNumber
     });
 }
Esempio n. 6
0
 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()
     });
 }
Esempio n. 7
0
 public void VerifyMessageBodyWithRangesReserved(Tuple <long, long?>[] ranges)
 {
     ExpectedBody.Add(new RangesReservedStatement {
         Items = ranges.ToRangeDescriptors().ToList()
     });
 }
Esempio n. 8
0
 public void VerifyMessageBodyWithExtensions(Tuple <long, long?>[] ranges)
 {
     ExpectedBody.Add(new ExtensionsStatement {
         Items = ranges.ToRangeDescriptors().ToList()
     });
 }
Esempio n. 9
0
 public void VerifyMessageBodyWithEmptyMessage(string innerMessageName)
 {
     ExpectedBody.Add(new MessageStatement {
         Name = innerMessageName
     });
 }
Esempio n. 10
0
 public void VerifyMessageBodyWithEmptyEnum(string enumName)
 {
     ExpectedBody.Add(new EnumStatement {
         Name = enumName
     });
 }