public void testUpdateTask() {
// recherche de la story
Story story = new StoryImpl();
story.setTasks(new HashSet<Task>());
Task task = new TaskImpl();
task.setDaysEstimated(2);
task.setShortDescription("scooby");
task.setPersistanceId(1);
task.setPersistanceVersion(3);
story.getTasks().add(task);
mockStoryRepository.expectFindByPersistanceId(1, story);
// validation (sans erreurs)
mockTaskValidator.expectValidate(new Ignore(), AgilePlanningObjectFactory.getErrors());
// modification
mockStoryRepository.acceptAddOrUpdate_Story(story);
Errors errorsFromService = storyService.updateTask(1,5,"doo", 4, 1, 7);
// V�rifie les appels
MockCore.verify();
// aucune erreur n'est retourn�e
assertFalse(errorsFromService.hasErrors());
// test de l'ajout de la t�che dans le liste de la story
for (Iterator iterator = story.getTasks().iterator(); iterator.hasNext();) {
Task taskUpdated = (Task) iterator.next();
assertEquals("doo", taskUpdated.getShortDescription());
assertEquals(5.0, taskUpdated.getDaysEstimated());
assertEquals(1, taskUpdated.getPersistanceId());
assertEquals(7, taskUpdated.getPersistanceVersion());
// une seule t�che dans la liste
break;
}