action.run();
}
@Test
public void shouldSetTheImageOfTheActionToBeTheSameAsTheImageOfTheFirstCategory() {
ICategory first = mock(ICategory.class);
ImageDescriptor firstImage = mock(ImageDescriptor.class);
given(first.getImageDescriptor()).willReturn(firstImage);
ICategory second = mock(ICategory.class);
ImageDescriptor secondImage = mock(ImageDescriptor.class);
given(second.getImageDescriptor()).willReturn(secondImage);
ICategory[] categories = {first, second};
IAction action = create(mock(ICategoryProvider.class), categories);
assertThat(action.getImageDescriptor(), sameInstance(first.getImageDescriptor()));
}