@Test public void shouldReturnFalseIfIsNOTVariantPointClass() { NamedElement a = Klass.create().build(); boolean result = StereotypeHelper.isVariationPoint(a); assertEquals("isVariationPoint should return false", false, result); }
@Test public void shouldReturnFalseIfIsNotConcern() throws ModelNotFoundException, ModelIncompleteException, SMartyProfileNotAppliedToModelExcepetion { Classifier a = Klass.create().withName("Car").withStereotypes("interface").build(); boolean result = StereotypeHelper.hasConcern(a); assertEquals("isConcern should return false", false, result); }
@Test public void shouldTestHasStereotype() throws ModelNotFoundException, ModelIncompleteException, SMartyProfileNotAppliedToModelExcepetion { Classifier a = Klass.create().withName("Bird").withStereotypes("variationPoint", "alternative_OR").build(); assertTrue(StereotypeHelper.hasStereotype(a, "variationPoint")); assertFalse(StereotypeHelper.hasStereotype(a, "wtf")); }
@Test public void shouldReturnFalseIfIsNotVariability() throws ModelNotFoundException, ModelIncompleteException, SMartyProfileNotAppliedToModelExcepetion { Classifier a = Klass.create().withName("game").withStereotypes("interface", "variationPoint").build(); boolean result = StereotypeHelper.isVariability(a); assertEquals("isVariability should return false", false, result); }
@Test public void shouldReturnTrueIfIsVariantPointClass() throws ModelNotFoundException, ModelIncompleteException, SMartyProfileNotAppliedToModelExcepetion { NamedElement a = Klass.create().withName("Car").withStereotypes("variationPoint").build(); Stereotype ste = ModelElementHelper.getAllStereotypes(a).get(0); boolean result = StereotypeHelper.isVariationPoint(ste); assertEquals("isVariationPoint should return true", true, result); }