Beispiel #1
0
 internal override bool RecordCall(Step calledStep)
 {
     try
     {
         return base.RecordCall(calledStep);
     }
     catch (Exception)
     {
         invocationExceptionThrown = true;
         throw;
     }
 }
Beispiel #2
0
        internal virtual bool RecordCall(Step calledStep)
        {
            foreach (var step in steps)
            {
                if (step == calledStep)
                {
                    CountCall(calledStep);
                    return true;
                }

                if (step is Loop)
                {
                    var loop = (Loop) step;

                    if (loop.RecordCall(calledStep))
                        return true;
                }

                step.EnsureComplete(calledStep + " was called");
            }

            return false;
        }
Beispiel #3
0
 internal static void Record(Step calledStep)
 {
     EnsureActiveSequence("Mock invocation");
     Instance.RecordCall(calledStep);
 }
Beispiel #4
0
 internal Step CreateStep(object setup, Times expectedCalls)
 {
     var step = new Step(expectedCalls, "''" + setup + "'");
     LastCreatedActiveLoop().steps.Add(step);
     return step;
 }
Beispiel #5
0
 private bool EnteringLoopWith(Step calledStep)
 {
     return !Started || calledStep.Complete;
 }
Beispiel #6
0
        private void CountCall(Step calledStep)
        {
            if (EnteringLoopWith(calledStep))
            {
                if (Started)
                    ResetSteps();

                calledStep.CountCall();
                CountCall();
            }
            else
                calledStep.CountCall();
        }
Beispiel #7
0
 private bool EnteringLoopWith(Step calledStep)
 {
     return(!Started || calledStep.Complete);
 }