/// <summary> /// Provides the failed expectations /// </summary> /// <returns></returns> public HashSet <ModelEvent> FailedExpectations() { HashSet <ModelEvent> retVal = new HashSet <ModelEvent>(); foreach (ModelEvent modelEvent in Events) { Expect expect = modelEvent as Expect; if ((expect != null) && expect.State == Expect.EventState.TimeOut) { retVal.Add(expect); } ModelInterpretationFailure failure = modelEvent as ModelInterpretationFailure; if (failure != null) { retVal.Add(failure); } } return(retVal); }
/// <summary> /// Registers the errors raised during evaluation and create ModelInterpretationFailure for each one of them /// </summary> /// <param name="errors"></param> private void RegisterErrors(Dictionary<Utils.ModelElement, List<ElementLog>> errors) { foreach (KeyValuePair<Utils.ModelElement, List<ElementLog>> pair in errors) { foreach (ElementLog log in pair.Value) { switch (log.Level) { case ElementLog.LevelEnum.Error: ModelInterpretationFailure modelInterpretationFailure = new ModelInterpretationFailure(log, pair.Key, null); ModelElement modelElement = pair.Key as ModelElement; if (modelElement != null) { modelInterpretationFailure.Explanation = modelElement.Explain; } EventTimeLine.AddModelEvent(modelInterpretationFailure, this, true); break; case ElementLog.LevelEnum.Warning: break; case ElementLog.LevelEnum.Info: break; } } } }