@Test public void testCorrectCountryCodeWith32bitSID1() throws ResolutionException { List<Result> expectedResult = new ArrayList<Result>(); expectedResult.add(new Result("C", "E1", "GB")); Resolver resolver = new Resolver(); resolver.setDabSId("E1C00098"); List<Result> actualResult = resolver.resolveGCC(); assertEquals("GB + C479 must return one result of ce1", expectedResult, actualResult); }
@Test public void testCorrectCountryCodeWithPI3() throws ResolutionException { List<Result> expectedResult = new ArrayList<Result>(); expectedResult.add(new Result("A", "E0", "AT")); Resolver resolver = new Resolver(); resolver.setIsoCountryCode("AT"); resolver.setRdsPiCode("A479"); List<Result> actualResult = resolver.resolveGCC(); assertEquals("AT + 5479 must return one result of ae0", expectedResult, actualResult); }
@Test public void testECCWithSID1() throws ResolutionException { List<Result> expectedResult = new ArrayList<Result>(); expectedResult.add(new Result("D", "E0", "DE")); Resolver resolver = new Resolver(); resolver.setExtendedCountryCode("E0"); resolver.setDabSId("D479"); List<Result> actualResult = resolver.resolveGCC(); assertEquals("E0 + D479 must return one result of de0", expectedResult, actualResult); }
@Test public void testAdjacentCountryCodeWithPI2() throws ResolutionException { List<Result> expectedResult = new ArrayList<Result>(); expectedResult.add(new Result("2", "E3", "IE")); Resolver resolver = new Resolver(); resolver.setIsoCountryCode("GB"); resolver.setRdsPiCode("2479"); List<Result> actualResult = resolver.resolveGCC(); assertEquals("GB + 2479 must return one result of ie3", expectedResult, actualResult); }
/* * Tests where the given PI Code doesn't match the Country Code but does of * a country or countries adjacent to it */ @Test public void testAdjacentCountryCodeWithPI1() throws ResolutionException { List<Result> expectedResult = new ArrayList<Result>(); expectedResult.add(new Result("D", "E0", "DE")); Resolver resolver = new Resolver(); resolver.setIsoCountryCode("ch"); resolver.setRdsPiCode("d479"); List<Result> actualResult = resolver.resolveGCC(); assertEquals("CH + D479 must return one result of de0", expectedResult, actualResult); }
@Test public void testAdjacentCountryCodeWithPI3() throws ResolutionException { List<Result> expectedResult = new ArrayList<Result>(); expectedResult.add(new Result("5", "E0", "IT")); expectedResult.add(new Result("5", "E2", "SK")); Resolver resolver = new Resolver(); resolver.setIsoCountryCode("AT"); resolver.setRdsPiCode("5479"); List<Result> actualResult = resolver.resolveGCC(); assertEquals("AT + 5479 must return two results of 5e0 & 5e2", expectedResult, actualResult); }