public void Add(int callIndex)
 {
     if (callIndex < 0)
     {
         throw SequenceSetupException.NegativeCallIndexException(callIndex);
     }
     if (callIndices.IndexOf(callIndex) != -1)
     {
         throw SequenceSetupException.RepeatedCallIndexInSetupException(callIndex);
     }
     callIndices.Add(callIndex);
 }
예제 #2
0
 private void AddExpectedInvocations(IInvocable setUp)
 {
     foreach (var sequenceInvocationIndex in setUp.SequenceInvocationIndices)
     {
         try
         {
             expectedInvocations.Add(sequenceInvocationIndex, setUp);
         }
         catch (ArgumentException)
         {
             throw SequenceSetupException.RepeatedCallIndexAcrossSetupsException(sequenceInvocationIndex);
         }
     }
 }
예제 #3
0
 private void SetIsInvocationIndices(bool isInvocationIndices)
 {
     if (hasSetSequenceType)
     {
         if (this.isInvocationIndices != isInvocationIndices)
         {
             throw SequenceSetupException.MixedTimesAndCallIndicesException();
         }
     }
     else
     {
         this.isInvocationIndices = isInvocationIndices;
         hasSetSequenceType       = true;
     }
 }