Skip to content

DB Issue #2

@ghost

Description

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions