Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kosovo control area EICode handling #176

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public Country getCountry() {
case "10YGR-HTSO-----Y", "10YCB-GREECE---2" -> Country.GR;
case "10YIT-GRTN-----B", "10YCB-ITALY----1" -> Country.IT;
case "10YDK-1--------W" -> Country.DK;
case "10Y1001C--00100H" -> Country.XK;
default -> throw new IllegalArgumentException("Unknown CountryEICode: " + codeString + ".");
};
}
Expand Down Expand Up @@ -104,6 +105,7 @@ public String getCode() {
case GR -> "10YGR-HTSO-----Y";
case IT -> "10YIT-GRTN-----B";
case DK -> "10YDK-1--------W";
case XK -> "10Y1001C--00100H";
default -> throw new IllegalArgumentException("Unknown CountryEICode for Country " + country + ".");
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ void testEicCodeConvergence() {
assertEquals(Country.IT, new CountryEICode("10YIT-GRTN-----B").getCountry());
assertEquals(Country.IT, new CountryEICode("10YCB-ITALY----1").getCountry());
assertEquals(Country.DK, new CountryEICode("10YDK-1--------W").getCountry());
assertEquals(Country.XK, new CountryEICode("10Y1001C--00100H").getCountry());
IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> new CountryEICode("invalid code"));
assertEquals("Unknown CountryEICode: invalid code.", e.getMessage());
}
Expand Down Expand Up @@ -84,6 +85,7 @@ void testEicCodeFromCountry() {
assertEquals("10YGR-HTSO-----Y", new CountryEICode(Country.GR).getCode());
assertEquals("10YIT-GRTN-----B", new CountryEICode(Country.IT).getCode());
assertEquals("10YDK-1--------W", new CountryEICode(Country.DK).getCode());
assertEquals("10Y1001C--00100H", new CountryEICode(Country.XK).getCode());
IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> new CountryEICode(Country.BR));
assertEquals("Unknown CountryEICode for Country BR.", e.getMessage());
}
Expand Down
Loading