public ExpectedTrace(ExpectedTrace expectedTrace) { this.Trace = TraceGroup.GetNewTraceGroup(expectedTrace.Trace); this.SortBeforeVerification = expectedTrace.SortBeforeVerification; this.Filters.AddRange(expectedTrace.Filters); CopyVerifyAndIgnoreTypes(expectedTrace); }
public void CopyVerifyAndIgnoreTypes(ExpectedTrace expectedTrace) { _useVerifyTypes = expectedTrace._useVerifyTypes; _ignoreTypes = new HashSet <String>(expectedTrace._ignoreTypes); _verifyTypes = new HashSet <String>(expectedTrace._verifyTypes); _ignoredStates = new HashSet <WorkflowInstanceState>(expectedTrace._ignoredStates); }
public ExpectedTrace FilterExpectedTrace(ExpectedTrace et) { // This can be any combination of ordered/unordered traces, and we have to maintain that architecture // use copy constructor to maintain Expected traces' settings ExpectedTrace expectedTrace = new ExpectedTrace(et); // copy constructor will also copy of the expected traces, need to clear them expectedTrace.Trace = FilterTraceGroup(et.Trace); return(expectedTrace); }
/// <summary> /// Constructor /// </summary> public static void Validate(ActualTrace actualTrace, ExpectedTrace expectedTrace, bool traceTracking) { TraceValidator.s_actualTrace = actualTrace; TraceValidator.s_expectedTrace = expectedTrace; TraceValidator.s_errorList = new List <string>(); TraceValidator.s_stepCounts = new Dictionary <string, StepCount>(); TestTraceManager.OptionalLogTrace("[TraceValidator]Unfiltered expected trace:\n{0}", expectedTrace.ToString()); TestTraceManager.OptionalLogTrace("[TraceValidator]Unfiltered actual trace:\n{0}", actualTrace.ToString()); TraceValidator.NormalizeExpectedTrace(expectedTrace.Trace); TraceValidator.RemoveIgnorableSteps(expectedTrace.Trace); TraceValidator.PrepareExpectedTrace(expectedTrace.Trace, false, null, -1); TraceValidator.PrepareActualTrace(); if (traceTracking) { //Log.TraceInternal("[TraceValidator]Filtered expected trace:\n{0}", expectedTrace.ToString()); //Log.TraceInternal("[TraceValidator]Filtered actual trace:\n{0}", actualTrace.ToString()); //Log.TraceInternal("[TraceValidator]Doing count validation..."); } TraceValidator.CheckStepCounts(); TraceValidator.CheckErrors(); if (traceTracking) { //Log.TraceInternal("[TraceValidator]Validating..."); } TraceValidator.ValidateFirst(expectedTrace.Trace, 0); TraceValidator.CheckErrors(); if (traceTracking) { //Log.TraceInternal("[TraceValidator]ExpectedTrace: Validation complete."); } }
public void Validate(ExpectedTrace expectedTrace, bool logTraces) { lock (_steps) { if (expectedTrace.SortBeforeVerification) { // copy the expected trace, remove activity traces and verify workflow instnace traces ExpectedTrace etrace = new ExpectedTrace(expectedTrace); ActualTrace atrace = new ActualTrace(this); etrace.AddIgnoreTypes(typeof(ActivityTrace), typeof(UserTrace)); TraceValidator.Validate(atrace, etrace, logTraces); // now verify the activity traces, after they have been ordered expectedTrace.AddIgnoreTypes(typeof(WorkflowInstanceTrace)); expectedTrace.AddIgnoreTypes(typeof(UserTrace)); this.OrderTraces(); TraceValidator.Validate(this, expectedTrace); } else { TraceValidator.Validate(this, expectedTrace, logTraces); } } }
public void Validate(ExpectedTrace expectedTrace) { this.Validate(expectedTrace, true); }
public static void Validate(ActualTrace actualTrace, ExpectedTrace expectedTrace) { Validate(actualTrace, expectedTrace, true); }