Tue, 28 Jul 2020 14:44:48 +0200
adds solver test
20 | 1 | package de.uapcore.sudoku; |
2 | ||
3 | import org.junit.jupiter.api.AfterEach; | |
4 | import org.junit.jupiter.api.BeforeEach; | |
5 | import org.junit.jupiter.api.Test; | |
6 | ||
7 | import javax.swing.*; | |
8 | ||
9 | import static org.junit.jupiter.api.Assertions.assertEquals; | |
10 | import static org.junit.jupiter.api.Assertions.assertTrue; | |
11 | ||
12 | class SudokuTest { | |
13 | ||
14 | private Sudoku subject; | |
15 | ||
16 | @BeforeEach | |
17 | void init() { | |
18 | subject = new Sudoku(); | |
19 | } | |
20 | ||
21 | @AfterEach | |
22 | void destroy() { | |
23 | subject.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); | |
24 | subject.dispose(); | |
25 | } | |
26 | ||
27 | @Test | |
28 | void testDefaultCloseOperation() { | |
29 | assertEquals(WindowConstants.EXIT_ON_CLOSE, subject.getDefaultCloseOperation()); | |
30 | } | |
31 | ||
32 | @Test | |
33 | void testMinimumSize() { | |
34 | assertEquals(subject.getSize(), subject.getMinimumSize()); | |
35 | } | |
36 | ||
37 | @Test | |
38 | void testLocationByPlattform() { | |
39 | assertTrue(subject.isLocationByPlatform()); | |
40 | } | |
41 | } |