Skip to content

Commit

Permalink
add test for resetToNormal()
Browse files Browse the repository at this point in the history
  • Loading branch information
koentsje committed Apr 13, 2014
1 parent eca23b2 commit c714aad
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.jboss.tools.aesh.ui.internal.document;


import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.aesh.ui.internal.util.ColorConstants;
import org.jboss.tools.aesh.ui.internal.util.FontManager;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -15,12 +15,7 @@ public class StyleImplTest {

@Before
public void setup() {
testStyleRange =
new StyleRange(
99,
999,
Display.getDefault().getSystemColor(SWT.COLOR_DARK_GRAY),
Display.getDefault().getSystemColor(SWT.COLOR_GRAY));
testStyleRange = new StyleRange();
testStyleImpl = new StyleImpl(testStyleRange);
}

Expand All @@ -36,5 +31,16 @@ public void testGetStyleRange() {
Assert.assertEquals(testStyleRange, testStyleImpl.getStyleRange());
}

@Test
public void testResetToNormal() {
testStyleRange.font = FontManager.INSTANCE.getItalicBold();
testStyleRange.background = ColorConstants.CYAN;
testStyleRange.foreground = ColorConstants.GREEN;
testStyleImpl.resetToNormal();
Assert.assertEquals(FontManager.INSTANCE.getDefault(), testStyleRange.font);
Assert.assertEquals(ColorConstants.DEFAULT_BACKGROUND, testStyleRange.background);
Assert.assertEquals(ColorConstants.DEFAULT_FOREGROUND, testStyleRange.foreground);
}


}

0 comments on commit c714aad

Please sign in to comment.