protected void LocalCurrency_ParseResult_Null()
        {
            // arrange
            ScalarType scalar = CreateType <LocalCurrencyType>();

            // act
            IValueNode result = scalar.ParseResult(null);

            // assert
            Assert.Equal(NullValueNode.Default, result);
        }
示例#2
0
        protected void ExpectParseResultToThrowSerializationException <TType>(object?runtimeValue)
            where TType : ScalarType
        {
            // arrange
            ScalarType scalar = CreateType <TType>();

            // act
            Exception?result = Record.Exception(() => scalar.ParseResult(runtimeValue));

            // assert
            Assert.IsType <SerializationException>(result);
        }
示例#3
0
        protected void ExpectParseResultToMatchType <TType>(
            object?valueSyntax,
            Type type)
            where TType : ScalarType
        {
            // arrange
            ScalarType scalar = CreateType <TType>();

            // act
            IValueNode result = scalar.ParseResult(valueSyntax);

            // assert
            Assert.Equal(type, result.GetType());
        }