コード例 #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());
        }