package qub;

import org.junit.Test;

import static org.junit.Assert.*;

public class IssueTests
{
    @Test
    public void constructor()
    {
        final Issue issue = new Issue("test message", new Span(1, 2), Issue.Type.Warning);
        assertEquals("test message", issue.getMessage());
        assertEquals(new Span(1, 2), issue.getSpan());
        assertEquals(Issue.Type.Warning, issue.getType());
        assertEquals("Warning [1, 3): \"test message\"", issue.toString());
    }

    @Test
    public void warning()
    {
        final Issue issue = Issue.warning("abc", 7, 10);
        assertEquals("abc", issue.getMessage());
        assertEquals(new Span(7, 10), issue.getSpan());
        assertEquals(Issue.Type.Warning, issue.getType());
    }

    @Test
    public void error()
    {
        final Issue issue = Issue.error("abc", 7, 10);
        assertEquals("abc", issue.getMessage());
        assertEquals(new Span(7, 10), issue.getSpan());
        assertEquals(Issue.Type.Error, issue.getType());
    }
}

@@ -11,139 +11,415 @@
 b;%0A%0A
-import org.junit.Test;%0A%0Aimport static org.junit.Assert.*;%0A%0Apublic class IssueTests%0A%7B%0A    @Test%0A    public void constructor()%0A    %7B%0A
+public class IssueTests%0A%7B%0A    public static void test(final TestRunner runner)%0A    %7B%0A        runner.testGroup(%22Issue%22, new Action0()%0A        %7B%0A            @Override%0A            public void run()%0A            %7B%0A                runner.test(%22constructor()%22, new Action1%3CTest%3E()%0A                %7B%0A                    @Override%0A                    public void run(Test test)%0A                    %7B%0A                
     
@@ -505,32 +505,53 @@
 rning);%0A        
+                test.
 assertEquals(%22te
@@ -545,17 +545,16 @@
 ertEqual
-s
 (%22test m
@@ -583,32 +583,53 @@
 age());%0A        
+   
+             test.
 assertEquals(new
@@ -615,33 +615,32 @@
 test.assertEqual
-s
 (new Span(1, 2),
@@ -658,32 +658,53 @@
 pan());%0A        
+                test.
 assertEquals(Iss
@@ -690,33 +690,32 @@
 test.assertEqual
-s
 (Issue.Type.Warn
@@ -737,32 +737,53 @@
 ype());%0A        
+                test.
 assertEquals(%22Wa
@@ -777,17 +777,16 @@
 ertEqual
-s
 (%22Warnin
@@ -841,53 +841,241 @@
     
-%7D%0A%0A    @
+                %7D%0A                %7D);%0A%0A                runner.test(%22warning()%22, new Action1%3C
 Test
+%3E()
 %0A    
-public void warning()%0A    %7B%0A
+            %7B%0A                    @Override%0A                    public void run(Test test)%0A                    %7B%0A                
     
@@ -1127,32 +1127,53 @@
 7, 10);%0A        
+  
+              test.
 assertEquals(%22ab
@@ -1159,33 +1159,32 @@
 test.assertEqual
-s
 (%22abc%22, issue.ge
@@ -1196,32 +1196,53 @@
 age());%0A        
+                test.
 assertEquals(new
@@ -1228,33 +1228,32 @@
 test.assertEqual
-s
 (new Span(7, 10)
@@ -1272,32 +1272,53 @@
 pan());%0A        
+                test.
 assertEquals(Iss
@@ -1304,33 +1304,32 @@
 test.assertEqual
-s
 (Issue.Type.Warn
@@ -1359,51 +1359,239 @@
     
-%7D%0A%0A    @
+                %7D%0A                %7D);%0A%0A                runner.test(%22error()%22, new Action1%3C
 Test
+%3E()
 %0A    
-public void error()%0A    %7B%0A
+            %7B%0A                    @Override%0A                    public void run(Test test)%0A                    %7B%0A                
     
@@ -1641,32 +1641,53 @@
 7, 10);%0A        
+  
+              test.
 assertEquals(%22ab
@@ -1681,17 +1681,16 @@
 ertEqual
-s
 (%22abc%22, 
@@ -1710,32 +1710,53 @@
 age());%0A        
+                test.
 assertEquals(new
@@ -1750,17 +1750,16 @@
 ertEqual
-s
 (new Spa
@@ -1794,16 +1794,37 @@
         
+                test.
 assertEq
@@ -1826,17 +1826,16 @@
 ertEqual
-s
 (Issue.T
@@ -1859,20 +1859,88 @@
 getType());%0A
+                    %7D%0A                %7D);%0A            %7D%0A        %7D);%0A
     %7D%0A%7D%0A

Convert Issue tests