ExpectationCollectionOfI.cs 992 B

123456789101112131415161718192021222324252627282930
  1. // -----------------------------------------------------------------------
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. // -----------------------------------------------------------------------
  4. using System;
  5. using System.Collections.ObjectModel;
  6. using System.Collections.Generic;
  7. namespace System.UnitTesting
  8. {
  9. public class ExpectationCollection<TInputAndOutput> : Collection<Expectation<TInputAndOutput>>
  10. {
  11. public void Add(TInputAndOutput inputAndOutput)
  12. {
  13. Add(inputAndOutput, inputAndOutput);
  14. }
  15. public void AddRange(IEnumerable<TInputAndOutput> inputAndOutputs)
  16. {
  17. foreach (TInputAndOutput inputAndOutput in inputAndOutputs)
  18. {
  19. Add(inputAndOutput);
  20. }
  21. }
  22. public void Add(TInputAndOutput input, TInputAndOutput output)
  23. {
  24. Add(new Expectation<TInputAndOutput>(input, output));
  25. }
  26. }
  27. }