Esempio n. 1
0
        public void ParseValue_Should_Pass_When_Value(string typeName)
        {
            // arrange
            INamedInputType type = CreateInputType(typeName);

            // act
            IValueNode literal = type.ParseValue(_geometry);

            // assert
            literal.ToString().MatchSnapshot();
        }
Esempio n. 2
0
        public void ParseResult_Should_Pass_When_Serialized(string typeName)
        {
            // arrange
            INamedInputType type       = CreateInputType(typeName);
            object?         serialized = type.Serialize(_geometry);

            // act
            IValueNode literal = type.ParseResult(serialized);

            // assert
            literal.ToString().MatchSnapshot();
        }
        public void ParseValue_Should_Pass_When_Value(string typeName)
        {
            // arrange
            var             inputFormatter = new InputFormatter();
            INamedInputType type           = CreateInputType(typeName);

            // act
            IValueNode literal = inputFormatter.FormatValue(_geometry, type);

            // assert
            literal.ToString().MatchSnapshot();
        }
        public void ParseValue_Should_Pass_When_Serialized(string typeName)
        {
            // arrange
            ILeafType type       = CreateLeafType(typeName);
            var       serialized = type.Serialize(_geometry);

            // act
            IValueNode literal = type.ParseValue(serialized);

            // assert
            literal.ToString().MatchSnapshot();
        }
Esempio n. 5
0
 public static IError ArgumentValueIsNotCompatible(
     this IDocumentValidatorContext context,
     ArgumentNode node,
     IInputType locationType,
     IValueNode valueNode)
 {
     return(ErrorBuilder.New()
            .SetMessage(Resources.ErrorHelper_ArgumentValueIsNotCompatible)
            .AddLocation(valueNode)
            .SetPath(context.CreateErrorPath())
            .SetExtension("argument", node.Name.Value)
            .SetExtension("argumentValue", valueNode.ToString())
            .SetExtension("locationType", locationType.Print())
            .SpecifiedBy("sec-Values-of-Correct-Type")
            .Build());
 }
Esempio n. 6
0
 public override string ToString()
 {
     return($"Property: {property} = {value.ToString()}");
 }