public class DeleteHypertextEmptyTermsCommandTest extends EMFfitTestCase{
@Test
public void testDoRunForTermLinkTermLinkTerm() {
Hypertext hypertext = EMFfitModelFactory.eINSTANCE.createHypertext();
Term term1 = EMFfitModelFactory.eINSTANCE.createTerm();
Link link1 = EMFfitModelFactory.eINSTANCE.createLink();
Term term2 = EMFfitModelFactory.eINSTANCE.createTerm();
Link link2 = EMFfitModelFactory.eINSTANCE.createLink();
Term term3 = EMFfitModelFactory.eINSTANCE.createTerm();
term1.setVisibleContent("foo ");
link1.setVisibleContent("link1");
term2.setVisibleContent("");
link2.setVisibleContent("link2");
term3.setVisibleContent(" bar");
hypertext.getContent().add(term1);
hypertext.getContent().add(link1);
hypertext.getContent().add(term2);
hypertext.getContent().add(link2);
hypertext.getContent().add(term3);
project.addModelElement(hypertext);
new DeleteHypertextEmptyTermsCommand(hypertext).runWithoutUnicaseCommand();
assertEquals(4, hypertext.getContent().size());
assertEquals("foo ", hypertext.getContent().get(0).getVisibleContent());
assertEquals("link1", hypertext.getContent().get(1).getVisibleContent());
assertEquals("link2", hypertext.getContent().get(2).getVisibleContent());
assertEquals(" bar", hypertext.getContent().get(3).getVisibleContent());
}