First database tests

This commit is contained in:
Riley Schneider
2025-12-03 17:30:33 +01:00
parent 26f7ecbee6
commit bc0e30860c
56 changed files with 109 additions and 1264 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());
}
}