First runnable tests for Database / Commented out Good/BadCasesTests (not relevant to this branch)

This commit is contained in:
Riley Schneider
2025-12-03 18:19:48 +01:00
parent 8c4849fdf0
commit 04f2087456
6 changed files with 111 additions and 5 deletions

View File

@@ -0,0 +1,39 @@
package hhn.temp.project;
import hhn.temp.project.provider.DatabaseManager;
import hhn.temp.project.provider.SimpleDatabaseManager;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.sql.SQLException;
import static org.junit.jupiter.api.Assertions.*;
public class DatabaseBadCasesTest {
private DatabaseManager<DatabaseGoodCasesTest.TestClass> databaseManager;
public class TestClass {
private int id;
private String dataString;
private int dataInteger;
public TestClass(int id, String dataString, int dataInteger) {
this.id = id;
this.dataString = dataString;
this.dataInteger = dataInteger;
}
}
@BeforeEach
public void setup() {
databaseManager = new SimpleDatabaseManager<>();
}
@Test
@DisplayName("Assert connection failed")
public void assertConnectionFailed() {
assertThrows(SQLException.class, () -> databaseManager.connect());
}
}