package com.fishercoder;

import com.fishercoder.solutions._207;
import org.junit.BeforeClass;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

public class _207Test {
    private static _207.Solution1 test;
    private static int[][] prerequisites;
    private static int numCourses;

    @BeforeClass
    public static void setup() {
        test = new _207.Solution1();
    }

    @Test
    public void test1() {
        numCourses = 2;
        prerequisites = new int[][]{{0, 1}};
        assertEquals(true, test.canFinish(numCourses, prerequisites));
    }

    @Test
    public void test2() {
        numCourses = 8;
        prerequisites = new int[][]{
                {3, 0},
                {3, 1},
                {5, 3},
                {5, 2},
                {6, 3},
                {6, 1},
                {7, 3},
                {7, 4},
                {4, 2},

        };
        assertEquals(true, test.canFinish(numCourses, prerequisites));
    }
}

@@ -222,20 +222,70 @@
 lution1 
+solution1;%0A    priva
 te
+ 
 st
+atic _207.Solution2 solution2
 ;%0A    pr
@@ -414,20 +414,67 @@
         
-test
+solution1 = new _207.Solution1();%0A        solution2
  = new _
@@ -477,33 +477,33 @@
 ew _207.Solution
-1
+2
 ();%0A    %7D%0A%0A    @
@@ -621,36 +621,117 @@
 ertEquals(true, 
-test
+solution1.canFinish(numCourses, prerequisites));%0A        assertEquals(true, solution2
 .canFinish(numCo
@@ -1113,20 +1113,585 @@
 s(true, 
-test
+solution1.canFinish(numCourses, prerequisites));%0A        assertEquals(true, solution2.canFinish(numCourses, prerequisites));%0A    %7D%0A%0A    @Test%0A    public void test3() %7B%0A        numCourses = 8;%0A        prerequisites = new int%5B%5D%5B%5D%7B%0A                %7B3, 2%7D,%0A                %7B3, 0%7D,%0A                %7B5, 3%7D,%0A                %7B5, 1%7D,%0A                %7B7, 3%7D,%0A                %7B7, 0%7D,%0A                %7B6, 3%7D,%0A                %7B6, 4%7D,%0A                %7B4, 1%7D,%0A%0A        %7D;%0A        assertEquals(true, solution1.canFinish(numCourses, prerequisites));%0A        assertEquals(true, solution2
 .canFini

refactor 207