package com.chbi.ui;

import com.chbi.ApplicationConfiguration;
import com.chbi.rest.DataProvider;
import com.chbi.rest.UrlRewriter;
import com.chbi.ui.entities.BuildBox;
import com.chbi.ui.entities.JobColor;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;

import static org.assertj.core.api.Assertions.assertThat;

public class BuildJobControllerTest {

    private BuildJobController jobController;
    private BuildBox box;

    @Before
    public void setUp() {
        jobController = new BuildJobController(Mockito.mock(DataProvider.class), Mockito.mock(ApplicationConfiguration.class),
                Mockito.mock(UrlRewriter.class), Mockito.mock(GifProvider.class));

        box = new BuildBox();
    }

    @Test
    public void test_that_animated_blue_is_handled_as_green() {
        box.withColor(JobColor.blue_anime);

        assertThat(jobController.isNotGreen().apply(box)).isFalse();
    }

    @Test
    public void test_that_blue_is_handled_as_green() {
        box.withColor(JobColor.blue);

        assertThat(jobController.isNotGreen().apply(box)).isFalse();
    }

    @Test
    public void test_that_aborted_is_handled_as_not_green() {
        box.withColor(JobColor.aborted);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_aborted_anime_is_handled_as_not_green() {
        box.withColor(JobColor.aborted_anime);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_notbuilt_is_handled_as_not_green() {
        box.withColor(JobColor.notbuilt);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_notbuilt_anime_is_handled_as_not_green() {
        box.withColor(JobColor.notbuilt_anime);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_red_is_handled_as_not_green() {
        box.withColor(JobColor.red);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_red_anime_is_handled_as_not_green() {
        box.withColor(JobColor.red_anime);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_yellow_is_handled_as_not_green() {
        box.withColor(JobColor.yellow);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }

    @Test
    public void test_that_yellow_anime_is_handled_as_not_green() {
        box.withColor(JobColor.yellow_anime);

        assertThat(jobController.isNotGreen().apply(box)).isTrue();
    }
}
@@ -893,37 +893,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isFalse()
@@ -1072,37 +1072,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isFalse()
@@ -1261,37 +1261,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -1461,37 +1461,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -1651,37 +1651,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -1853,37 +1853,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -2033,37 +2033,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -2225,37 +2225,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -2411,37 +2411,36 @@
 er.isNotGreen().
-apply
+test
 (box)).isTrue();
@@ -2621,13 +2621,12 @@
 n().
-apply
+test
 (box

Fix unit tests