Commit 090bc838 authored by mathieugautron's avatar mathieugautron

Fix the bug into MultipleReferenceToTravelTest

parent 7aa9a727
......@@ -22,9 +22,11 @@ class MultipleReferenceToTravelTest {
@BeforeEach
void setUp() {
Correspondence corr = new Correspondence(new City("France","Paris"),new City("US","New-York"), LocalDateTime.of(2012, 12,10,9,9), LocalDateTime.of(2012, 12,17,9,9));
for (int i = 0; i< this.numberOfElement; i++) {
for (int i = 0; i< this.numberOfElement - 1; i++) {
list.add(new Travel(corr));
}
Correspondence deleteLater = new Correspondence(new City("Allemagne","Berlin"),new City("US","New-York"), LocalDateTime.of(2011, 12,10,9,9), LocalDateTime.of(2013, 12,17,9,9));
list.add(new Travel(deleteLater));
}
@Test
......@@ -79,12 +81,12 @@ class MultipleReferenceToTravelTest {
}
}
try {
this.toTest.remove(list.get(5));
this.toTest.remove(list.get(numberOfElement-1));
} catch (MultipleReference.NumberOfElementException e) {
e.printStackTrace();
}
assertFalse(this.toTest.contains(list.get(5)));
assertFalse(list.get(5).getCalendarAssociation().isSet());
assertFalse(this.toTest.contains(list.get(numberOfElement-1)));
assertFalse(list.get(numberOfElement-1).getCalendarAssociation().isSet());
}
@Test
......@@ -177,11 +179,11 @@ class MultipleReferenceToTravelTest {
}
}
try {
this.toTest.basicRemove(list.get(5));
this.toTest.basicRemove(list.get(numberOfElement-1));
} catch (MultipleReference.NumberOfElementException e) {
e.printStackTrace();
}
assertFalse(this.toTest.contains(list.get(5)));
assertFalse(this.toTest.contains(list.get(numberOfElement-1)));
}
@Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment