mirror of
https://github.com/processing/processing4.git
synced 2026-01-31 12:21:07 +01:00
Clean up tests prior to addressing #579.
This commit is contained in:
@@ -15,7 +15,7 @@ public class ProblemFactoryTest {
|
||||
|
||||
private PdePreprocessIssue pdePreprocessIssue;
|
||||
private List<Integer> tabStarts;
|
||||
private Editor editor;
|
||||
|
||||
private List<Integer> starts;
|
||||
|
||||
@Before
|
||||
@@ -25,26 +25,12 @@ public class ProblemFactoryTest {
|
||||
tabStarts = new ArrayList<>();
|
||||
tabStarts.add(5);
|
||||
|
||||
editor = Mockito.mock(Editor.class);
|
||||
Mockito.when(editor.getLineStartOffset(3)).thenReturn(10);
|
||||
Mockito.when(editor.getLineStopOffset(3)).thenReturn(12);
|
||||
|
||||
starts = new ArrayList<>();
|
||||
starts.add(0);
|
||||
starts.add(5);
|
||||
starts.add(10);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void buildWithEditor() {
|
||||
Problem problem = ProblemFactory.build(pdePreprocessIssue, tabStarts, 15, editor);
|
||||
|
||||
Assert.assertEquals(3, problem.getLineNumber());
|
||||
Assert.assertEquals("test", problem.getMessage());
|
||||
Assert.assertEquals(10, problem.getStartOffset());
|
||||
Assert.assertEquals(11, problem.getStopOffset());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void buildWithoutEditor() {
|
||||
Problem problem = ProblemFactory.build(pdePreprocessIssue, tabStarts);
|
||||
|
||||
Reference in New Issue
Block a user