src/test/java/de/uapcore/sudoku/SudokuTest.java

Tue, 28 Jul 2020 14:44:48 +0200

author
Mike Becker <universe@uap-core.de>
date
Tue, 28 Jul 2020 14:44:48 +0200
changeset 23
07b9adaed78e
parent 20
a95423d37588
permissions
-rw-r--r--

adds solver test

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());
    }
}

mercurial