use of org.eclipse.scout.rt.shared.data.basic.FontSpec in project scout.rt by eclipse.
the class CellTest method testConstructor_copy.
/**
* When a new Cell is crated as a copy <br>
* , all values should be copied and that there are no calls to an observer
*/
@Test
public void testConstructor_copy() throws Exception {
Object value = new Object();
String text = "text";
String iconId = "iconId";
String tooltipText = "Tooltip";
String bgColor = "eeeeee";
String fgColor = "ff0000";
String cssClass = "myClass";
FontSpec font = FontSpec.parse("Arial-bold-italic-16");
ICellObserver observer = Mockito.mock(ICellObserver.class);
Cell c = new Cell();
c.setValue(value);
c.setText(text);
c.setIconId(iconId);
c.setTooltipText(tooltipText);
c.setHorizontalAlignment(100);
c.setBackgroundColor(bgColor);
c.setForegroundColor(fgColor);
c.setFont(font);
c.setHtmlEnabled(true);
c.setCssClass(cssClass);
c.setMandatory(true);
c.setObserver(observer);
Cell copy = new Cell(c);
assertSame(value, copy.getValue());
assertEquals(text, copy.getText());
assertEquals(iconId, copy.getIconId());
assertEquals(tooltipText, copy.getTooltipText());
assertEquals(cssClass, copy.getCssClass());
assertTrue(copy.isHtmlEnabled());
assertTrue(copy.isMandatory());
assertEquals(100, c.getHorizontalAlignment());
assertEquals(bgColor, c.getBackgroundColor());
assertEquals(fgColor, c.getForegroundColor());
assertEquals(cssClass, c.getCssClass());
assertEquals(font.toPattern(), c.getFont().toPattern());
assertTrue(c.isMandatory());
assertTrue(c.isHtmlEnabled());
assertSame(observer, c.getObserver());
verifyZeroInteractions(observer);
}
use of org.eclipse.scout.rt.shared.data.basic.FontSpec in project scout.rt by eclipse.
the class CellTest method testSetFont.
@Test
public void testSetFont() {
Cell c = new Cell();
ICellObserver observer = installMockObserver(c);
FontSpec font = FontSpec.parse("Arial-bold-italic-13");
c.setFont(font);
assertEquals(font.toPattern(), c.getFont().toPattern());
verify(observer).cellChanged(c, ICell.FONT_BIT);
}
Aggregations