package me.itszooti.geojson;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
import static org.hamcrest.Matchers.notNullValue;

import org.junit.Before;
import org.junit.Test;

public class GeoFeatureTest {

	private GeoFeature feature;
	
	@Before
	public void before() {
		feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0)));
		feature.setProperty("number", 2);
		feature.setProperty("letter", "B");
	}
	
	@Test
	public void getId() {
		assertThat(feature.getId(), equalTo("a_test_feature"));
	}
	
	@Test
	public void getGeometry() {
		GeoGeometry geometry = feature.getGeometry();
		assertThat(geometry, notNullValue());
		assertThat(geometry, instanceOf(GeoPoint.class));
	}
	
	@Test
	public void getProperty() {
		assertThat(feature.getProperty("number"), equalTo((Object)2));
		assertThat(feature.getProperty("letter"), equalTo((Object)"B"));
	}
	
	@Test
	public void isGeoObject() {
		assertThat(feature, instanceOf(GeoObject.class));
	}
	
}

@@ -220,16 +220,39 @@
 Value;%0A%0A
+import java.util.Set;%0A%0A
 import o
@@ -1001,32 +1001,278 @@
 ));%0A%09%7D%0A%09%0A%09@Test%0A
+%09public void getPropertyNames() %7B%0A%09%09Set%3CString%3E names = feature.getPropertyNames();%0A%09%09assertThat(names.size(), equalTo(2));%0A%09%09assertThat(names.contains(%22number%22), equalTo(true));%0A%09%09assertThat(names.contains(%22letter%22), equalTo(true));%0A%09%7D%0A%09%0A%09@Test%0A
 %09public void isG

Test for property names in GeoFeature