package de.hft.stuttgart.citygml.green.alkis;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.jupiter.api.Test;
import de.hft.stuttgart.citygml.green.osm.GreenEnricher;


class AlkisGreenEnricherTest
{
	@Test
	void testAlkisGreen() throws Exception {
		//NOTE: From https://transfer.hft-stuttgart.de/gitlab/circulargreensimcity/circulargreensimcity/-/wikis/Fallstudien/Gromb%C3%BChl
		Path outputGML = Paths.get("data/Grombühl_v4_case_study_alkis_test.gml");
		Files.deleteIfExists(outputGML);
		assertFalse(Files.exists(outputGML));
		String[] args = new String[] { "data/Grombühl_v4_case_study.gml", // Input GML
				"data/tn_09663/Nutzung.shp", // ALKIS Data
				//NOTE: From https://transfer.hft-stuttgart.de/gitlab/circulargreensimcity/circulargreensimcity/-/issues/26#note_6544
				"data/Trees/Trees_realisticScenario_20240201.shp", // Added trees, in Baumkatasterformat,
				"alkis_test" // Output GML suffix
		};
		AlkisGreenEnricher.main(args);
		assertTrue(Files.exists(outputGML));
	}

	@Test
	void testGreen() throws Exception {
		Path outputGML = Paths.get("data/Grombühl_v4_case_study_enrich_test.gml");
		Files.deleteIfExists(outputGML);
		assertFalse(Files.exists(outputGML));
		String[] args = new String[] { "data/Grombühl_v4_case_study.gml", // Input GML
				"data/Trees/Trees_realisticScenario_20240201.shp", // Added trees, in Baumkatasterformat,
				"enrich_test" // Output GML suffix
		};
		GreenEnricher.main(args);
		assertTrue(Files.exists(outputGML));
	}
}
