1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/test/java/de/uapcore/sudoku/SudokuTest.java Tue Jul 28 13:48:59 2020 +0200 1.3 @@ -0,0 +1,41 @@ 1.4 +package de.uapcore.sudoku; 1.5 + 1.6 +import org.junit.jupiter.api.AfterEach; 1.7 +import org.junit.jupiter.api.BeforeEach; 1.8 +import org.junit.jupiter.api.Test; 1.9 + 1.10 +import javax.swing.*; 1.11 + 1.12 +import static org.junit.jupiter.api.Assertions.assertEquals; 1.13 +import static org.junit.jupiter.api.Assertions.assertTrue; 1.14 + 1.15 +class SudokuTest { 1.16 + 1.17 + private Sudoku subject; 1.18 + 1.19 + @BeforeEach 1.20 + void init() { 1.21 + subject = new Sudoku(); 1.22 + } 1.23 + 1.24 + @AfterEach 1.25 + void destroy() { 1.26 + subject.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); 1.27 + subject.dispose(); 1.28 + } 1.29 + 1.30 + @Test 1.31 + void testDefaultCloseOperation() { 1.32 + assertEquals(WindowConstants.EXIT_ON_CLOSE, subject.getDefaultCloseOperation()); 1.33 + } 1.34 + 1.35 + @Test 1.36 + void testMinimumSize() { 1.37 + assertEquals(subject.getSize(), subject.getMinimumSize()); 1.38 + } 1.39 + 1.40 + @Test 1.41 + void testLocationByPlattform() { 1.42 + assertTrue(subject.isLocationByPlatform()); 1.43 + } 1.44 +}