public void VerifySingleFieldFieldsWithSingleOption(ElementTypeIdentifierPath messageType, string fieldName
                                                            , OptionIdentifierPath optionName)
        {
            const LabelKind label       = LabelKind.Required;
            IVariant        fieldType   = Variant.Create(ProtoType.Double);
            IVariant        optionConst = Constant.Create(true);

            IEnumerable <FieldOption> GetFieldOptions() => GetRange(
                new FieldOption {
                Name = optionName, Value = optionConst
            }
                );

            IEnumerable <NormalFieldStatement> GetNormalFields()
            {
                var fieldNumber = FieldNumber;

                yield return(new NormalFieldStatement
                {
                    Name = fieldName,
                    Label = label,
                    FieldType = fieldType,
                    Number = fieldNumber,
                    Options = GetFieldOptions().ToList()
                });
            }

            ExpectedTopLevel = new ExtendStatement
            {
                MessageType = messageType,
                Items       = GetNormalFields().ToList <IExtendBodyItem>()
            };
        }
Пример #2
0
 public void IdentifierPathConstantSupportedWithWhiteSpace(OptionIdentifierPath optionName
                                                           , IVariant constant, WhiteSpaceAndCommentOption whiteSpaceOption)
 {
     RenderingOptions = new StringRenderingOptions {
         WhiteSpaceAndCommentRendering = whiteSpaceOption
     };
     IdentifierPathConstantSupported(optionName, constant);
 }
Пример #3
0
        public void IdentifierPathConstantSupported(OptionIdentifierPath optionName, IVariant constant)
        {
            GetRange <object>(optionName, constant).AllNotNull();

            ExpectedProto.Items.Add(
                new OptionStatement {
                Name = optionName, Value = Assert.IsAssignableFrom <IVariant <IdentifierPath> >(constant)
            }
                );
        }
Пример #4
0
        public void FloatingPointLiteralConstantSupported(OptionIdentifierPath optionName, IVariant constant, IStringRenderingOptions options)
        {
            /* TODO: TBD: This is STILL an issue some FOUR MONTHS later.
             * http://youtrack.jetbrains.com/issue/RSRP-471906 / "R# ignoring my xunit user furnished configuration" */

            GetRange <object>(optionName, constant, options).AllNotNull();

            RenderingOptions = options;

            ExpectedProto.Items.Add(
                new OptionStatement {
                Name = optionName, Value = Assert.IsAssignableFrom <IVariant <double> >(constant)
            }
                );
        }
Пример #5
0
 public void IntegerLiteralConstantSupportedWithWhiteSpace(OptionIdentifierPath optionName
                                                           , IVariant constant, WhiteSpaceAndCommentOption whiteSpaceOption)
 => IntegerLiteralConstantSupported(optionName, constant
                                    , new StringRenderingOptions {
     WhiteSpaceAndCommentRendering = whiteSpaceOption
 });
 /// <summary>
 /// Visits the <paramref name="path"/>.
 /// </summary>
 /// <param name="path"></param>
 protected virtual void VisitOptionIdentifierPath(OptionIdentifierPath path)
 {
 }
 public void VerifySingleFieldFieldsWithSingleOptionWithWhiteSpace(ElementTypeIdentifierPath messageType
                                                                   , string fieldName, OptionIdentifierPath optionName, WhiteSpaceAndCommentOption whiteSpaceOption)
 {
     RenderingOptions = new StringRenderingOptions {
         WhiteSpaceAndCommentRendering = whiteSpaceOption
     };
     VerifySingleFieldFieldsWithSingleOption(messageType, fieldName, optionName);
 }