Added new tests that needs to be implemented.
This commit is contained in:
@@ -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, "", "")));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user