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