Skip to content
This repository has been archived by the owner on Mar 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #49 from Koralovy/TestMock
Browse files Browse the repository at this point in the history
TestMock
  • Loading branch information
Koralovy authored Jan 24, 2022
2 parents 1de6414 + af3a5b5 commit dc739c9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/java/TestMock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pl.put.poznan.sortingmadness.logic.BogoSort;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.*;
import java.util.ArrayList;
import java.util.Collections;


public class TestMock {
@Test
void bogo_test() {
BogoSort mockObject = mock(BogoSort.class);
when(mockObject.sortSimple(new ArrayList<>(), -1)).thenReturn(new ArrayList<>());
assertEquals(Collections.emptyList(), mockObject.sortSimple(new ArrayList<>(), -1));
}
}

0 comments on commit dc739c9

Please sign in to comment.