Package com.github.eclipsecolortheme.test

Source Code of com.github.eclipsecolortheme.test.ColorThemeSettingTest

package com.github.eclipsecolortheme.test;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;

import org.junit.Before;
import org.junit.Test;

import com.github.eclipsecolortheme.Color;
import com.github.eclipsecolortheme.ColorThemeSetting;

public class ColorThemeSettingTest {
    private ColorThemeSetting setting;

    @Before
    public void setUp() {
        setting = new ColorThemeSetting("#00FFAA");
    }

    @Test
    public void initialValues() {
        assertThat(setting.isBoldEnabled(), nullValue());
        assertThat(setting.isItalicEnabled(), nullValue());
        assertThat(setting.isStrikethroughEnabled(), nullValue());
        assertThat(setting.isUnderlineEnabled(), nullValue());
    }

    @Test
    public void getColor() {
        Color color = setting.getColor();
        assertThat(color, notNullValue());
        assertThat(color.asHex(), is("#00FFAA"));
    }

    @Test
    public void decorationBold() {
        setting.setBoldEnabled(true);
        assertThat(setting.isBoldEnabled(), is(true));
        setting.setBoldEnabled(false);
        assertThat(setting.isBoldEnabled(), is(false));
    }

    @Test
    public void decorationItalic() {
        setting.setBoldEnabled(true);
        assertThat(setting.isBoldEnabled(), is(true));
        setting.setBoldEnabled(false);
        assertThat(setting.isBoldEnabled(), is(false));
    }

    @Test
    public void decorationUnderline() {
        setting.setBoldEnabled(true);
        assertThat(setting.isBoldEnabled(), is(true));
        setting.setBoldEnabled(false);
        assertThat(setting.isBoldEnabled(), is(false));
    }

    @Test
    public void decorationStrikethrough() {
        setting.setStrikethroughEnabled(true);
        assertThat(setting.isStrikethroughEnabled(), is(true));
        setting.setStrikethroughEnabled(false);
        assertThat(setting.isStrikethroughEnabled(), is(false));
    }
}
TOP

Related Classes of com.github.eclipsecolortheme.test.ColorThemeSettingTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.