Exemplo n.º 1
0
        /// <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.");
            }
        }