public void testIsValidActivityNodeName() { Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("MyActivity")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("MyActivity1")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("myActivityNode1")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("_withUnderscore")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("someWhitespaceX X")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("activity-activity")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName("")); Assert.IsTrue(ConsistencyUtil.isValidActivityNodeName(null)); Assert.IsFalse(ConsistencyUtil.isValidActivityNodeName("aQuote\"")); }
public override List <String> doRule(SQLElement eaElement, SQLWrapperClasses.SQLRepository repository) { List <String> results = new List <string>(); if (eaElement.Stereotype == SDMModelingMain.SdmContainerStereotype) { Activity activity = new Activity(eaElement, repository); if (eaElement.ParentID != activity.OwningOperation.EaMethod.ParentID) { results.Add("SDM Activity and related EOperation are no children of the same EClass"); } if (!ConsistencyUtil.isValidActivityNodeName(activity.Name)) { results.Add("SDM Activity names should consist of: a-z, A-Z, 0-9, _, -, whitespaces,"); } } return(results); }