示例#1
0
 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.");
 }
示例#2
0
 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.");
 }
示例#3
0
 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.");
 }
示例#4
0
 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());
 }