use of com.helger.css.decl.CSSDeclaration in project ph-css by phax.
the class CSSShortHandDescriptorTest method testPadding2.
@Test
public void testPadding2() {
final CSSShortHandDescriptor aSHD = CSSShortHandRegistry.getShortHandDescriptor(ECSSProperty.PADDING);
assertNotNull(aSHD);
final CSSDeclaration aDecl = CSSReaderDeclarationList.readFromString("padding:1px 3px", ECSSVersion.CSS30).getDeclarationAtIndex(0);
assertNotNull(aDecl);
final List<CSSDeclaration> aSplittedDecls = aSHD.getSplitIntoPieces(aDecl);
assertNotNull(aSplittedDecls);
assertEquals(4, aSplittedDecls.size());
assertEquals("padding-top:1px", aSplittedDecls.get(0).getAsCSSString(CWS));
assertEquals("padding-right:3px", aSplittedDecls.get(1).getAsCSSString(CWS));
assertEquals("padding-bottom:1px", aSplittedDecls.get(2).getAsCSSString(CWS));
assertEquals("padding-left:3px", aSplittedDecls.get(3).getAsCSSString(CWS));
}
use of com.helger.css.decl.CSSDeclaration in project ph-css by phax.
the class CSSShortHandDescriptorTest method testMargin2.
@Test
public void testMargin2() {
final CSSShortHandDescriptor aSHD = CSSShortHandRegistry.getShortHandDescriptor(ECSSProperty.MARGIN);
assertNotNull(aSHD);
final CSSDeclaration aDecl = CSSReaderDeclarationList.readFromString("margin:1px 3px", ECSSVersion.CSS30).getDeclarationAtIndex(0);
assertNotNull(aDecl);
final List<CSSDeclaration> aSplittedDecls = aSHD.getSplitIntoPieces(aDecl);
assertNotNull(aSplittedDecls);
assertEquals(4, aSplittedDecls.size());
assertEquals("margin-top:1px", aSplittedDecls.get(0).getAsCSSString(CWS));
assertEquals("margin-right:3px", aSplittedDecls.get(1).getAsCSSString(CWS));
assertEquals("margin-bottom:1px", aSplittedDecls.get(2).getAsCSSString(CWS));
assertEquals("margin-left:3px", aSplittedDecls.get(3).getAsCSSString(CWS));
}
use of com.helger.css.decl.CSSDeclaration in project ph-css by phax.
the class CSSShortHandDescriptorTest method testBorder3a.
@Test
public void testBorder3a() {
final CSSShortHandDescriptor aSHD = CSSShortHandRegistry.getShortHandDescriptor(ECSSProperty.BORDER);
assertNotNull(aSHD);
final CSSDeclaration aDecl = CSSReaderDeclarationList.readFromString("border:dashed 1px red", ECSSVersion.CSS30).getDeclarationAtIndex(0);
assertNotNull(aDecl);
final List<CSSDeclaration> aSplittedDecls = aSHD.getSplitIntoPieces(aDecl);
assertNotNull(aSplittedDecls);
assertEquals(3, aSplittedDecls.size());
assertEquals("border-style:dashed", aSplittedDecls.get(0).getAsCSSString(CWS));
assertEquals("border-width:1px", aSplittedDecls.get(1).getAsCSSString(CWS));
assertEquals("border-color:red", aSplittedDecls.get(2).getAsCSSString(CWS));
}
use of com.helger.css.decl.CSSDeclaration in project ph-css by phax.
the class CSSShortHandDescriptorTest method testMargin3.
@Test
public void testMargin3() {
final CSSShortHandDescriptor aSHD = CSSShortHandRegistry.getShortHandDescriptor(ECSSProperty.MARGIN);
assertNotNull(aSHD);
final CSSDeclaration aDecl = CSSReaderDeclarationList.readFromString("margin:1px 3px 5px", ECSSVersion.CSS30).getDeclarationAtIndex(0);
assertNotNull(aDecl);
final List<CSSDeclaration> aSplittedDecls = aSHD.getSplitIntoPieces(aDecl);
assertNotNull(aSplittedDecls);
assertEquals(4, aSplittedDecls.size());
assertEquals("margin-top:1px", aSplittedDecls.get(0).getAsCSSString(CWS));
assertEquals("margin-right:3px", aSplittedDecls.get(1).getAsCSSString(CWS));
assertEquals("margin-bottom:5px", aSplittedDecls.get(2).getAsCSSString(CWS));
assertEquals("margin-left:3px", aSplittedDecls.get(3).getAsCSSString(CWS));
}
use of com.helger.css.decl.CSSDeclaration in project ph-css by phax.
the class CSSShortHandDescriptorTest method testBorderColor1.
@Test
public void testBorderColor1() {
final CSSShortHandDescriptor aSHD = CSSShortHandRegistry.getShortHandDescriptor(ECSSProperty.BORDER_COLOR);
assertNotNull(aSHD);
final CSSDeclaration aDecl = CSSReaderDeclarationList.readFromString("border-color: red", ECSSVersion.CSS30).getDeclarationAtIndex(0);
assertNotNull(aDecl);
final List<CSSDeclaration> aSplittedDecls = aSHD.getSplitIntoPieces(aDecl);
assertNotNull(aSplittedDecls);
assertEquals(4, aSplittedDecls.size());
assertEquals("border-top-color:red", aSplittedDecls.get(0).getAsCSSString(CWS));
assertEquals("border-right-color:red", aSplittedDecls.get(1).getAsCSSString(CWS));
assertEquals("border-bottom-color:red", aSplittedDecls.get(2).getAsCSSString(CWS));
assertEquals("border-left-color:red", aSplittedDecls.get(3).getAsCSSString(CWS));
}
Aggregations