예제 #1
0
        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());
        }