Ejemplo 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);
        }
Ejemplo 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);
        }