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 11 12 using System; 13 using System.Collections; 14 using NUnit.Framework; 15 16 namespace MonoTests.System.Collections { 17 public class ReadOnlyCollectionBaseTest { 18 // We need a concrete class to test the abstract base class 19 public class ConcreteReadOnlyCollection : ReadOnlyCollectionBase 20 { 21 public override int Count { get { return -1; }} 22 } 23 24 // Make sure that the Count is 0 for a new object 25 [Test] TestZeroCountOnNew()26 public void TestZeroCountOnNew() 27 { 28 ConcreteReadOnlyCollection myCollection; 29 myCollection = new ConcreteReadOnlyCollection(); 30 Assert.IsTrue (-1 == myCollection.Count); 31 } 32 33 // Make sure we get an object from GetEnumerator() 34 [Test] TestGetEnumerator()35 public void TestGetEnumerator() 36 { 37 ConcreteReadOnlyCollection myCollection; 38 myCollection = new ConcreteReadOnlyCollection(); 39 Assert.IsTrue (null != myCollection.GetEnumerator()); 40 } 41 } 42 } 43