ReadOnlyCollectionBaseTest.cs 999 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // System.Collections.ReadOnlyCollectionBase
  3. // Test suite for System.Collections.ReadOnlyCollectionBase
  4. //
  5. // Author:
  6. // Nick D. Drochak II
  7. //
  8. // (C) 2001 Nick D. Drochak II
  9. //
  10. using System;
  11. using System.Collections;
  12. using NUnit.Framework;
  13. namespace MonoTests.System.Collections {
  14. public class ReadOnlyCollectionBaseTest : TestCase {
  15. // We need a concrete class to test the abstract base class
  16. public class ConcreteReadOnlyCollection : ReadOnlyCollectionBase
  17. {
  18. }
  19. // Make sure that the Count is 0 for a new object
  20. public void TestZeroCountOnNew()
  21. {
  22. ConcreteReadOnlyCollection myCollection;
  23. myCollection = new ConcreteReadOnlyCollection();
  24. Assert(0 == myCollection.Count);
  25. }
  26. // Make sure we get an object from GetEnumerator()
  27. public void TestGetEnumerator()
  28. {
  29. ConcreteReadOnlyCollection myCollection;
  30. myCollection = new ConcreteReadOnlyCollection();
  31. Assert(null != myCollection.GetEnumerator());
  32. }
  33. }
  34. }