public void ConvertPrimitiveValueToXElement_Throws_IfInputIsNotString() { Assert.Throws <ValidationException>( () => ODataEntryDeserializer.ConvertPrimitiveValue(123, typeof(XElement), "property", "type"), "The property 'property' on type 'type' must be a string."); }
public void ConvertPrimitiveValueToChar_Throws(string input) { Assert.Throws <ValidationException>( () => ODataEntryDeserializer.ConvertPrimitiveValue(input, typeof(char), "property", "type"), "The property 'property' on type 'type' must be a string with a length of 1."); }
public void ConvertPrimitiveValueToNullableChar_Throws() { Assert.Throws <ValidationException>( () => ODataEntryDeserializer.ConvertPrimitiveValue("123", typeof(char?), "property", "type"), "The property 'property' on type 'type' must be a string with a maximum length of 1."); }
public void ConvertPrimitiveValue_NonStandardPrimitives(object valueToConvert, object result, Type conversionType) { Assert.Equal(result.GetType(), ODataEntryDeserializer.ConvertPrimitiveValue(valueToConvert, conversionType, "", "").GetType()); Assert.Equal(result.ToString(), ODataEntryDeserializer.ConvertPrimitiveValue(valueToConvert, conversionType, "", "").ToString()); }