package lego;

import org.junit.Test;

import java.util.stream.Collectors;

import static org.junit.Assert.*;

public class RandomGraphTest {

    @Test
    public void getGraph() throws Exception {
        Graph graph = new RandomGraph().withSize(10).getGraph();
        assertEquals(10, graph.size());
    }

    @Test(expected = IllegalArgumentException.class)
    public void shouldThrowNegativeSize() throws Exception {
        Graph graph = new RandomGraph().withSize(-10).getGraph();
    }
}
@@ -35,46 +35,8 @@
 st;%0A
-%0Aimport java.util.stream.Collectors;%0A%0A
 impo
@@ -111,54 +111,274 @@
 Test
-%0A    public void getGraph() throws Exception %7B
+(expected = IllegalArgumentException.class)%0A    public void shouldThrowNegativeSize() throws Exception %7B%0A        new RandomGraph().withSize(-10).getGraph();%0A    %7D%0A%0A    @Test%0A    public void shouldGenerateCorrectEdges() throws Exception %7B%0A        final int size = 50;
 %0A   
@@ -423,18 +423,20 @@
 ithSize(
-10
+size
 ).getGra
@@ -437,24 +437,25 @@
 getGraph();%0A
+%0A
         asse
@@ -463,18 +463,20 @@
 tEquals(
-10
+size
 , graph.
@@ -488,192 +488,246 @@
 ));%0A
+%0A
     
-%7D%0A%0A
     
-@Test(expected = IllegalArgumentException.class)%0A    public void shouldThrowNegativeSize() throws Exception %7B%0A        Graph graph = new RandomGraph().withSize(-10).getGraph(
+graph.getStream().forEach(edge -%3E %7B%0A            assertTrue(edge.getStart() %3C size);%0A            assertTrue(edge.getStart() %3E= 0);%0A            assertTrue(edge.getEnd() %3C size);%0A            assertTrue(edge.getEnd() %3E= 0);%0A        %7D
 );%0A 

Update RandomGraphTest