System\Windows\Input\KeyValueSerializerTests.cs (9)
35Assert.Equal(expected, serializer.CanConvertToString(value, new CustomValueSerializerContext()));
44Assert.Equal(expected, serializer.ConvertToString(key, new CustomValueSerializerContext()));
56Assert.Throws<NotSupportedException>(() => serializer.ConvertToString(key, new CustomValueSerializerContext()));
68Assert.Throws<NotSupportedException>(() => serializer.ConvertToString(value, new CustomValueSerializerContext()));
79Assert.Throws<InvalidCastException>(() => serializer.ConvertToString(value, new CustomValueSerializerContext()));
95Assert.True(serializer.CanConvertFromString(value, new CustomValueSerializerContext()));
104Assert.Equal(expected, serializer.ConvertFromString(value, new CustomValueSerializerContext()));
112Assert.Throws<NotSupportedException>(() => serializer.ConvertFromString(null, new CustomValueSerializerContext()));
122Assert.Throws<ArgumentException>(() => serializer.ConvertFromString(value, new CustomValueSerializerContext()));