[Mono-list] Test-suite for System.Collections.SortedList
jr
jaaksimm@firm.ee
Fri, 22 Mar 2002 08:59:23 -0000
This is a multi-part message in MIME format.
----------part3c9af26b367a5
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello Mono-list,
I am new comer in the field of .NET and C#, so I tried out writing a test
suite as suggested in your web. For me its the first project where I see
that it is rather easy to start contributing, good job.
I attached the test file to the e-mail (SortedListTest.cs). It should be
placed under:
msc/class/corlib/Test/System.Collections/SortedListTest.cs
Of course, a row has to be added into AllTests.cs in that dir.
All tests passed on my Windows XP Professional box, except the test of
SortedList.Clear() method:
- it seems there is a contradiction with the MSDN documentation, which
claims that the Clear() method leaves the Capacity unchanged, whereas the
Capacity is altered.
Main ToDos:
- tests for properties of fixed-size and read-only (tests for catching
NotSupportedException). I didnt know an easy way to change the initial
values of these properties in SortedList.
- IEnumerable.GetEnumerator [Explicit Interface Implementation]. Could not
figure out what to do with such strange thing. :(
If you can guide me with these two To-Dos, I'm willing to implement them.
regards,
Jaak Simm
----------part3c9af26b367a5
Content-Type: application/octet-stream; name="SortedListTest.cs"
Content-Transfer-Encoding: base64
Ly8gU29ydGVkTGlzdFRlc3QuY3MgLSBOVW5pdCBUZXN0IENhc2VzIGZvciB0aGUgU3lzdGVtLkNv
bGxlY3Rpb25zLlNvcnRlZExpc3QgY2xhc3MNCi8vDQovLyBKYWFrIFNpbW0NCi8vDQovLyBUaGFu
a3MgZ28gdG8gRGF2aWQgQnJhbmR0IChidWNreUBrZXlzdHJlYW1zLmNvbSksDQovLyBiZWNhdXNl
IHRoaXMgZmlsZSBpcyBiYXNlZCBvbiBoaXMgQXJyYXlMaXN0VGVzdC5jcw0KLy8NCi8vIChDKSBY
aW1pYW4sIEluYy4gIGh0dHA6Ly93d3cueGltaWFuLmNvbQ0KLy8gDQovLyBtYWluIFRPRE86IGFk
ZGl0aW9uYWwgdGVzdHMgZm9yIGZ1bmN0aW9ucyBhZmZlY3RlZCBieQ0KLy8gICAgIC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