public class SetHypertextTextElementVisibleContentCommandTest extends EMFfitTestCase {
public void testDoRun() {
Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
term1.setVisibleContent("foo ");
Link link = EMFfitModelFactory.eINSTANCE.createLink();
link.setVisibleContent("link");
Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
term2.setVisibleContent(" bar");
hypertext.getContent().add(term1);
hypertext.getContent().add(link);
hypertext.getContent().add(term2);
new SetHypertextTextElementVisibleContentCommand(hypertext, 4, "newlink").runWithoutUnicaseCommand();
assertEquals(3, hypertext.getContent().size());
assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
assertEquals("newlink", hypertext.getContent().get(1).getVisibleContent());
assertEquals(" bar", hypertext.getContent().get(2).getVisibleContent());
new SetHypertextTextElementVisibleContentCommand(hypertext, 5, " newbar").runWithoutUnicaseCommand();
assertEquals(3, hypertext.getContent().size());
assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
assertEquals("newlink", hypertext.getContent().get(1).getVisibleContent());
assertEquals(" newbar", hypertext.getContent().get(2).getVisibleContent());
}