@Test public void testInvariantFeatureOf4() { String json = "{ type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0]}, " + "properties: {}}"; TurfAssertions.featureOf(Feature.fromJson(json), "Point", "myfn"); }
@Test public void testInvariantFeatureOf3() throws TurfException { String json = "{ type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }}"; thrown.expect(TurfException.class); thrown.expectMessage(startsWith("Invalid input to myfn: must be a Polygon, given Point")); TurfAssertions.featureOf(Feature.fromJson(json), "Polygon", "myfn"); }
@Test public void testInvariantFeatureOf1() throws TurfException { String json = "{ type: 'Feature', geometry: { type: 'Point', coordinates: [0, 0] }, " + "properties: {}}"; thrown.expect(TurfException.class); thrown.expectMessage(startsWith(".featureOf() requires a name")); TurfAssertions.featureOf(Feature.fromJson(json), "Polygon", null); }
@Test public void testInvariantFeatureOf2() throws TurfException { String json = "{ type: 'Feature'}"; thrown.expect(TurfException.class); thrown.expectMessage(startsWith("Invalid input to foo, Feature with geometry required")); TurfAssertions.featureOf(Feature.fromJson(json), "Polygon", "foo"); }