I have this test:
@Test
public void UpdateAllFooDatesToOneDayBeforeProvidedDate_TodaysDateAndFooDate_UpdatedDates() {
List<Foo> foos = new ArrayList<Foo>();
Date barDate = today;
Foo foo1 = setupFoo();
Foo foo2 = setupFoo();
foos.add(foo1);
foos.add(foo2);
foo1.setValidTo(dateUtil.adjustDaysOfDate(today, 5));
foo2.setValidTo(dateUtil.adjustDaysOfDate(today, 8));
modifyDates.updateAllFooDatesToOneDayBeforeProvidedDate(barDate, foos);
assertThat(foos, hasItems(...?));
}
updateAllFooDatesToOneDayBeforeProvidedDate (Date, List) simply changes the date property of all Foos to the day before barDate.
I am trying to use Hamcrest to help me claim that the list is updated, but I cannot get it to work.
Should I just use foos.get (n) .getDate () and claim on them?
What is the preferred way to claim that the date property of elements in foos has been updated correctly?
Edit: Typo
Roger source
share