From af3a5b5bafe3a1e937cb240b68994daef6576368 Mon Sep 17 00:00:00 2001 From: Koralovy <33037063+Koralovy@users.noreply.github.com> Date: Mon, 24 Jan 2022 20:50:57 +0100 Subject: [PATCH] TestMock --- src/test/java/TestMock.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/java/TestMock.java diff --git a/src/test/java/TestMock.java b/src/test/java/TestMock.java new file mode 100644 index 0000000..39a467f --- /dev/null +++ b/src/test/java/TestMock.java @@ -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)); + } +} \ No newline at end of file