The database allows for insertion of duplicate objects due to id auto updating. Here is the issue:
@Test
public void testIsDirty() {
Cargo test_cargo = new Cargo();
Assert.assertEquals(false, test_cargo.isDirty());
test_cargo.setStatus(Vehicle.Status.Delayed);
Assert.assertEquals(true, test_cargo.isDirty());
test_cargo.Update();
Assert.assertEquals(false, test_cargo.isDirty());
//test_cargo.Delete();
test_cargo.Delete();
}
This code will insert a new item and delete it. Which is as it is suppposed to do. The issue however if the database contains Ships 9, and 10. If I then use the default constructor for testing it will insert 11 and delete 9.
The database allows for insertion of duplicate objects due to id auto updating. Here is the issue:
This code will insert a new item and delete it. Which is as it is suppposed to do. The issue however if the database contains Ships 9, and 10. If I then use the default constructor for testing it will insert 11 and delete 9.