Esempio n. 1
0
        protected void ExpectDeserializeToThrowSerializationException <TType>(object runtimeValue)
            where TType : ScalarType
        {
            // arrange
            ScalarType scalar = CreateType <TType>();

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

            // assert
            Assert.IsType <SerializationException>(result);
        }
Esempio n. 2
0
        protected void ExpectDeserializeToMatch <TType>(
            object?resultValue,
            object?runtimeValue)
            where TType : ScalarType
        {
            // arrange
            ScalarType scalar = CreateType <TType>();

            // act
            object?result = scalar.Deserialize(resultValue);

            // assert
            Assert.Equal(resultValue, runtimeValue);
        }