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