public void CanConvert() { MicrosoftSpatialGeoJsonConverter converter = new MicrosoftSpatialGeoJsonConverter(); Assert.IsFalse(converter.CanConvert(typeof(Geography))); // This list is the implementation types. CanConvert will see these when serializing. List <Type> types = (from p in GeographyGeoJsons group p by p.Geography.GetType() into grouped select grouped.Key).Distinct().ToList(); foreach (Type type in types) { Assert.IsTrue(converter.CanConvert(type)); } // During a deserialization request, you pass the base classes, so these also must pass. types = (from p in GeographyGeoJsons group p by p.Geography.GetType().BaseType into grouped select grouped.Key).Distinct().ToList(); foreach (Type type in types) { Assert.IsTrue(converter.CanConvert(type)); } }
public void CanConvert() { MicrosoftSpatialGeoJsonConverter converter = new MicrosoftSpatialGeoJsonConverter(); Assert.IsTrue(converter.CanConvert(typeof(GeographyPoint))); }