Skip to content
Snippets Groups Projects
Commit 59be64fb authored by Dennis Eisold's avatar Dennis Eisold
Browse files

Unit Test für Codebuch hinzugefügt

parent 722b0a2f
No related branches found
No related tags found
No related merge requests found
package Enigma.model;
import org.junit.Assert;
import org.junit.Test;
import java.sql.SQLException;
public class CodebuchTest {
@Test
public void testToString() {
String expected = "Tag: 1\n" +
"Walzenlage: 1,3,2\n" +
"Ringstellung: 16,11,13\n" +
"Steckverbindung: CO,DI,FR,HU,JW,LS,TX\n";
try {
// Codebuch abrufen
Codebuch cb = new DatenbankSqlite().getCodebuch(1);
// Ausgabe auf der Konsole
String result = new DatenbankSqlite().getCodebuch(1).toString();
Assert.assertEquals(expected, result);
} catch (SQLException e) {
e.printStackTrace();
}
}
@Test
public void getTag() {
Codebuch cb = new Codebuch();
cb.setTag(1);
Assert.assertEquals(1, cb.getTag());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment