package nl.tudelft.lifetiles.graph;

import static org.junit.Assert.assertNull;
import nl.tudelft.lifetiles.graph.jgrapht.JGraphTGraphFactory;

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

public class FactoryProducerTest {
    FactoryProducer<String> fp;

    @Before
    public void setUp() throws Exception {
        fp = new FactoryProducer<String>();
    }

    @Test
    public void testGetWithParam() {
        GraphFactory<String> gf = fp.getFactory("JGraphT");
        assert (gf instanceof JGraphTGraphFactory<?>);
    }

    @Test
    public void testGetWrongParam() {
        GraphFactory<String> gf = fp.getFactory("libfoo");
        assertNull(gf);
    }

    @Test
    public void testGet() {
        GraphFactory<String> gf = fp.getFactory();
        assert (gf instanceof JGraphTGraphFactory<?>);
    }

}

@@ -34,51 +34,8 @@
 h;%0A%0A
-import static org.junit.Assert.assertNull;%0A
 impo
@@ -140,80 +140,218 @@
 nit.
-Test;%0A%0Apublic class FactoryProducerTest %7B%0A    FactoryProducer%3CString%3E fp
+Rule;%0Aimport org.junit.Test;%0Aimport org.junit.rules.ExpectedException;%0A%0Apublic class FactoryProducerTest %7B%0A    FactoryProducer%3CString%3E fp;%0A    @Rule%0A    public ExpectedException thrown= ExpectedException.none()
 ;%0A%0A 
@@ -664,32 +664,87 @@
 tWrongParam() %7B%0A
+        thrown.expect(IllegalArgumentException.class);%0A
         GraphFac
@@ -790,32 +790,8 @@
 %22);%0A
-        assertNull(gf);%0A
     

Repair test.