@Test
public void testBuildFeatureType() {

    String input = CSVTestStrategySupport.buildInputString("lat,lon,quux,morx\n");
    CSVFileState fileState = new CSVFileState(input, "foo");
    CSVLatLonStrategy strategy = new CSVLatLonStrategy(fileState);
    SimpleFeatureType featureType = strategy.getFeatureType();
    assertEquals("Invalid attribute count", 3, featureType.getAttributeCount());
    assertEquals("Invalid featuretype name", "foo", featureType.getName().getLocalPart());
    assertEquals("Invalid name", "foo", featureType.getTypeName());
    List<AttributeDescriptor> attrs = featureType.getAttributeDescriptors();
    assertEquals("Invalid number of attributes", 3, attrs.size());
    List<String> attrNames = new ArrayList<String>(2);
    for (AttributeDescriptor attr : attrs) {
        if (!(attr instanceof GeometryDescriptor)) {
            attrNames.add(attr.getName().getLocalPart());
        }
    }
    Collections.sort(attrNames);
    assertEquals("Invalid property descriptor", "morx", attrNames.get(0));
    assertEquals("Invalid property descriptor", "quux", attrNames.get(1));
    GeometryDescriptor geometryDescriptor = featureType.getGeometryDescriptor();
    GeometryType geometryType = geometryDescriptor.getType();
    assertEquals("Invalid geometry name", "location", geometryType.getName().getLocalPart());
}