public void ShouldReturnInvariantCulture()
 {
     Assert.AreEqual <CultureInfo>(CultureInfo.InvariantCulture, ObjectServices.GetSerializationCulture(typeof(Rect)));
     Assert.AreEqual <CultureInfo>(CultureInfo.InvariantCulture, ObjectServices.GetSerializationCulture(typeof(Geometry)));
 }
 public void ShouldReturnCurrentCultureForNullType()
 {
     Assert.AreEqual <CultureInfo>(CultureInfo.CurrentCulture, ObjectServices.GetSerializationCulture(null));
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Gets the serialization culture.
 /// </summary>
 /// <returns>Culture to serialize value.</returns>
 protected virtual CultureInfo GetSerializationCulture()
 {
     return(ObjectServices.GetSerializationCulture(_propertyItemValue.CollectionItemType));
 }
 public void ShouldReturnCurrentCultureForCultureInvariantTypes()
 {
     Assert.AreEqual <CultureInfo>(CultureInfo.CurrentCulture, ObjectServices.GetSerializationCulture(typeof(string)));
     Assert.AreEqual <CultureInfo>(CultureInfo.CurrentCulture, ObjectServices.GetSerializationCulture(typeof(int)));
 }
 /// <summary>
 /// Gets the serialization culture.
 /// </summary>
 /// <returns>Culture to serialize value.</returns>
 protected virtual CultureInfo GetSerializationCulture()
 {
     return(ObjectServices.GetSerializationCulture(_parentProperty.PropertyType));
 }