[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System/Collections Test
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System/Collections TestArrayList.cs,1.1,1.2 |
Date: |
Tue, 19 Nov 2002 00:48:16 -0500 |
Update of /cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System/Collections
In directory subversions:/tmp/cvs-serv6317/tests/runtime/System/Collections
Modified Files:
TestArrayList.cs
Log Message:
Add test cases for ArrayList to the test suite, fix the "ArrayList.Add"
bug, and fix up a few other test suite issues.
Index: TestArrayList.cs
===================================================================
RCS file:
/cvsroot/dotgnu-pnet/pnetlib/tests/runtime/System/Collections/TestArrayList.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** TestArrayList.cs 2 Oct 2002 08:47:35 -0000 1.1
--- TestArrayList.cs 19 Nov 2002 05:48:13 -0000 1.2
***************
*** 44,57 ****
}
! // Test running a foreach loop across a simple String array
! public void TestIterator()
! {
! int i;
! ArrayList l = new ArrayList();
!
! for (i=0;i<100;i++)
! {
! l.Insert(i,i.ToString());
! }
! }
}; // class TestArrayList
--- 44,117 ----
}
! // Test insertion into an array list.
! public void TestInsert()
! {
! int posn;
! ArrayList list = new ArrayList();
!
! for(posn = 0; posn < 100; ++posn)
! {
! AssertEquals(list.Count, posn);
! list.Insert(posn / 2, posn.ToString());
! AssertEquals(list.Count, posn + 1);
! AssertEquals(((String)(list[posn /
2])), posn.ToString());
! }
! }
!
! // Test adding to an array list.
! public void TestAdd()
! {
! int posn;
! ArrayList list = new ArrayList();
!
! for(posn = 0; posn < 100; ++posn)
! {
! AssertEquals(list.Count, posn);
! list.Add(posn.ToString());
! AssertEquals(list.Count, posn + 1);
! AssertEquals(((String)(list[posn])),
posn.ToString());
! }
! }
!
! // Test clearing an array list.
! public void TestClear()
! {
! ArrayList list = new ArrayList();
! int posn;
!
! // Clear an empty list.
! AssertEquals(list.Count, 0);
! list.Clear();
! AssertEquals(list.Count, 0);
!
! // Clear a list with 1 element.
! list.Add("element");
! AssertEquals(list.Count, 1);
! list.Clear();
! AssertEquals(list.Count, 0);
!
! // Clear a list with 10 elements.
! for(posn = 0; posn < 10; ++posn)
! {
! list.Add(posn);
! }
! AssertEquals(list.Count, 10);
! list.Clear();
! AssertEquals(list.Count, 0);
!
! // Attempt to clear a read-only list.
! list = ArrayList.ReadOnly(list);
! try
! {
! list.Clear();
!
! // We should never get here!
! Fail();
! }
! catch(NotSupportedException)
! {
! // The test was successfull if we get
here.
! }
! }
!
}; // class TestArrayList
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System/Collections TestArrayList.cs,1.1,1.2,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestString.cs,1.2,1.3
- Next by Date:
[Dotgnu-pnet-commits] CVS: pnet/samples I18N.CJK.dll,1.17,1.18 I18N.MidEast.dll,1.17,1.18 I18N.Other.dll,1.17,1.18 I18N.Rare.dll,1.17,1.18 I18N.West.dll,1.17,1.18 I18N.dll,1.18,1.19 System.Xml.dll,1.15,1.16 System.dll,1.19,1.20 mscorlib.dll,1.88,1.89
- Previous by thread:
[Dotgnu-pnet-commits] CVS: pnetlib/tests/runtime/System TestString.cs,1.2,1.3
- Next by thread:
[Dotgnu-pnet-commits] CVS: pnet/samples I18N.CJK.dll,1.17,1.18 I18N.MidEast.dll,1.17,1.18 I18N.Other.dll,1.17,1.18 I18N.Rare.dll,1.17,1.18 I18N.West.dll,1.17,1.18 I18N.dll,1.18,1.19 System.Xml.dll,1.15,1.16 System.dll,1.19,1.20 mscorlib.dll,1.88,1.89
- Index(es):