/*
 * Copyright (C) 2013-2014 Phokham Nonava
 *
 * Use of this source code is governed by the MIT license that can be
 * found in the LICENSE file.
 */
package com.fluxchess.pulse;

import org.junit.Test;

import java.lang.reflect.InvocationTargetException;

import static com.fluxchess.test.AssertUtil.assertUtilityClassWellDefined;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

public class ColorTest {

  @Test
  public void testUtilityClass()
      throws InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException {
    assertUtilityClassWellDefined(Color.class);
  }

  @Test
  public void testValues() {
    for (int color : Color.values) {
      assertThat(Color.values[color], is(color));
    }
  }

  @Test
  public void testIsValid() {
    for (int color : Color.values) {
      assertThat(Color.isValid(color), is(true));
    }

    assertThat(Color.isValid(Color.NOCOLOR), is(false));
  }

  @Test
  public void testOpposite() {
    assertThat(Color.opposite(Color.BLACK), is(Color.WHITE));
    assertThat(Color.opposite(Color.WHITE), is(Color.BLACK));
  }

}

@@ -252,16 +252,209 @@
 ption;%0A%0A
+import static com.fluxchess.pulse.Color.BLACK;%0Aimport static com.fluxchess.pulse.Color.NOCOLOR;%0Aimport static com.fluxchess.pulse.Color.WHITE;%0Aimport static com.fluxchess.pulse.Color.opposite;%0A
 import s
@@ -1136,22 +1136,16 @@
 isValid(
-Color.
 NOCOLOR)
@@ -1154,24 +1154,24 @@
 is(false));%0A
+
   %7D%0A%0A  @Test
@@ -1209,38 +1209,32 @@
 %0A    assertThat(
-Color.
 opposite(Color.B
@@ -1226,22 +1226,16 @@
 pposite(
-Color.
 BLACK), 
@@ -1237,22 +1237,16 @@
 CK), is(
-Color.
 WHITE));
@@ -1261,22 +1261,16 @@
 ertThat(
-Color.
 opposite
@@ -1270,22 +1270,16 @@
 pposite(
-Color.
 WHITE), 
@@ -1281,22 +1281,16 @@
 TE), is(
-Color.
 BLACK));

Add static import in ColorTest