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: E:U,O:H,T:Z,A:S,M:R,I:V,C:G,F:Q,B:X,Y:K\n";

		try {
			// Ausgabe auf der Konsole
			String result = new DatenbankSqlite().getCodebuch(1).toString();
			Assert.assertEquals(result, expected, result);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

	@Test
	public void getTag() {
		Codebuch cb = new Codebuch();
		cb.setTag(1);
		Assert.assertEquals(1, cb.getTag());
	}
}