Tue, 28 Jul 2020 14:27:14 +0200
bugfix: modified state is reset even when saving fails + more tests
package de.uapcore.sudoku; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import javax.swing.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; class SudokuTest { private Sudoku subject; @BeforeEach void init() { subject = new Sudoku(); } @AfterEach void destroy() { subject.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); subject.dispose(); } @Test void testDefaultCloseOperation() { assertEquals(WindowConstants.EXIT_ON_CLOSE, subject.getDefaultCloseOperation()); } @Test void testMinimumSize() { assertEquals(subject.getSize(), subject.getMinimumSize()); } @Test void testLocationByPlattform() { assertTrue(subject.isLocationByPlatform()); } }