StandardAtRuleFactory { public static StandardAtRule getByName(String atRuleName) { StandardAtRule standardAtRule = ALL.get(atRuleName.toLowerCase(Locale.ENGLISH)); return standardAtRule != null ? standardAtRule : new UnknownAtRule(atRuleName); } private  StandardAtRuleFactory(); static StandardAtRule getByName(String atRuleName); static List<StandardAtRule> getAll();  }
@Test public void should_return_a_valid_charset_at_rule_object() { StandardAtRule atRule = StandardAtRuleFactory.getByName("charset"); assertEquals(Charset.class, atRule.getClass()); assertEquals(atRule.getName(), "charset"); assertEquals(atRule.getLinks().size(), 1); assertEquals(atRule.getLinks().get(0), "https: assertEquals(atRule.isObsolete(), false); assertEquals(atRule.isExperimental(), false); }
@Test public void should_return_a_valid_charset_at_rule_object_uppercase_test() { StandardAtRule atRule = StandardAtRuleFactory.getByName("CHARSET"); assertEquals(Charset.class, atRule.getClass()); assertEquals(atRule.getName(), "charset"); assertEquals(atRule.getLinks().size(), 1); assertEquals(atRule.getLinks().get(0), "https: assertEquals(atRule.isObsolete(), false); assertEquals(atRule.isExperimental(), false); }
@Test public void should_return_a_valid_character_variant_at_rule_object() { StandardAtRule atRule = StandardAtRuleFactory.getByName("character-variant"); assertEquals(CharacterVariant.class, atRule.getClass()); assertEquals(atRule.getName(), "character-variant"); assertEquals(atRule.getLinks().size(), 2); assertEquals(atRule.getLinks().get(0), "https: assertEquals(atRule.getLinks().get(1), "https: assertEquals(atRule.isObsolete(), false); assertEquals(atRule.isExperimental(), true); }
@Test public void should_return_a_valid_keyframes_at_rule_object() { StandardAtRule atRule = StandardAtRuleFactory.getByName("keyframes"); assertEquals(Keyframes.class, atRule.getClass()); assertEquals(atRule.getName(), "keyframes"); assertEquals(atRule.getLinks().size(), 1); assertFalse(atRule.isObsolete()); assertTrue(atRule.isExperimental()); }