コード例 #1
0
 @Test
 public void testGetOriginAfterRemovingRuleFromStylesheet() {
   Rule instance = new Rule(Collections.EMPTY_LIST, Collections.EMPTY_LIST);
   Stylesheet stylesheet = new Stylesheet();
   stylesheet.getRules().add(instance);
   stylesheet.setOrigin(StyleOrigin.INLINE);
   stylesheet.getRules().remove(instance);
   StyleOrigin result = instance.getOrigin();
   assertNull(result);
 }
コード例 #2
0
 @Test
 public void testGetOriginAfterSettingOriginBeforeAddingRuleToStylesheet() {
   Rule instance = new Rule(Collections.EMPTY_LIST, Collections.EMPTY_LIST);
   Stylesheet stylesheet = new Stylesheet();
   stylesheet.setOrigin(StyleOrigin.INLINE);
   stylesheet.getRules().add(instance);
   StyleOrigin expResult = StyleOrigin.INLINE;
   StyleOrigin result = instance.getOrigin();
   assertEquals(expResult, result);
 }