/** Test of values method, of class Canton. */ @Test public void testValues() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testValues"); Canton[] result = Canton.values(); assertEquals(26, result.length); }
/** Test of fromDbKey method, of class Canton. */ @Test public void testFromDbKeyAg() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testFromDbKeyAg"); String aRecordKey = "19"; Canton expResult = Canton.AG; Canton result = Canton.fromDbKey(aRecordKey); assertEquals(expResult, result); }
/** Test of fromGeoId method, of class Canton. */ @Test public void testFromGeoIdBe() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testFromGeoIdBe"); int aGeoId = 2; Canton expResult = Canton.BE; Canton result = Canton.fromGeoId(aGeoId); assertEquals(expResult, result); }
/** Test of valueOf method, of class Canton. */ @Test public void testValueOf() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testValueOf"); String name = "BE"; Canton expResult = Canton.BE; Canton result = Canton.valueOf(name); assertEquals(expResult, result); }
/** Test of asDbKey method, of class Canton. */ @Test public void testAsDbKeyBe() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testAsDbKeyBe"); Canton instance = Canton.BE; String expResult = "02"; String result = instance.asDbKey(); assertEquals(expResult, result); }
/** Test of asGeoId method, of class Canton. */ @Test public void testAsGeoIdBe() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testAsGeoIdBe"); Canton instance = Canton.BE; Integer expResult = new Integer(2); Integer result = instance.asGeoId(); assertEquals(expResult, result); }
@Test public void testUniqueGeoIds() { ApplicationInfo.info( CantonTest.class, ApplicationInfo.TEST, ApplicationInfo.UNIT_TEST, "testUniqueGeoIds"); Set<Integer> uniqueIds = new HashSet<Integer>(); for (Canton canton : Canton.values()) { uniqueIds.add(canton.asGeoId()); } assertEquals(Canton.values().length, uniqueIds.size()); }