private static void TestReadMethod(SpatialType spatialType, List<object> coordinates, bool isGeography, Func<List<object>, bool, ICommonLoggingPipeline> getExpectedPipeline) { int expectedPropertyCount; var jsonObject = GetGeoJson(spatialType, coordinates, out expectedPropertyCount); var expectedPipeline = getExpectedPipeline(coordinates, isGeography); var actualPipeline = new CallSequenceLoggingPipeline(); var geoJsonObjectReader = new GeoJsonObjectReader(actualPipeline); if (isGeography) { geoJsonObjectReader.ReadGeography(jsonObject); } else { geoJsonObjectReader.ReadGeometry(jsonObject); } expectedPipeline.VerifyPipeline(actualPipeline); }
private static void SendToPipeline(IDictionary<string, object> members, SpatialPipeline pipeline, bool isGeography) { GeoJsonObjectReader reader = new GeoJsonObjectReader(pipeline); if (isGeography) { reader.ReadGeography(members); } else { reader.ReadGeometry(members); } }
private static void TestReadMethod(SpatialType[] spatialType, List<object>[] coordinates, bool isGeography, Func<Func<List<Object>, bool, ICommonLoggingPipeline>[], List<object>[], bool, ICommonLoggingPipeline> getExpectedPipeline, Func<List<Object>, bool, ICommonLoggingPipeline>[] innerGetExpectedPipeline) { // used for Collections int expectedPropertyCount; int epsgId = isGeography ? CoordinateSystem.DefaultGeography.EpsgId.Value : CoordinateSystem.DefaultGeometry.EpsgId.Value; var jsonObject = GetGeoJson(spatialType, coordinates, out expectedPropertyCount, epsgId); var expectedPipeline = getExpectedPipeline(innerGetExpectedPipeline, coordinates, isGeography); var actualPipeline = new CallSequenceLoggingPipeline(); var geoJsonObjectReader = new GeoJsonObjectReader(actualPipeline); if (isGeography) { geoJsonObjectReader.ReadGeography(jsonObject); } else { geoJsonObjectReader.ReadGeometry(jsonObject); } expectedPipeline.VerifyPipeline(actualPipeline); }