Added new tests that needs to be implemented.

This commit is contained in:
Riley Schneider
2025-12-03 23:04:21 +01:00
parent 995fba6fce
commit f2cc964d39
4 changed files with 87 additions and 27 deletions

View File

@@ -6,6 +6,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.sql.SQLException;
import static org.junit.jupiter.api.Assertions.*;
@@ -27,7 +28,21 @@ public class DatabaseBadCasesTest {
}
@BeforeEach
public void setup() {
public void setup() throws SQLException, IOException {
databaseManager = new SimpleDatabaseManager<>();
databaseManager.connect();
databaseManager.clearDatabase();
}
@Test
@DisplayName("Gets an object that may not be existent")
public void assertObjectShouldNotBeExistent() throws SQLException {
assertNull(databaseManager.getObject(999));
}
@Test
@DisplayName("Updates an object that does not exist")
public void assertUpdateNonExistentObject() throws SQLException {
assertNull(databaseManager.updateObject(123, new Task(1, 2, "", "")));
}
}