Coding Standards was Re: [Mono-list] Re: IEnumerators
Tue, 17 Jul 2001 11:22:11 -0700
> > Also, I think, there ought to be the sort of "skeleton" for all
> > collections
> > classes, because they share a great deal of functionality and behaviour,
> > Enumerators for example. Not necessary some code snippet but a
> > set of rules,
> > like these for Enumerators and corresponding tests-cases to check the
> > implementation. Any ideas?
I agree that any collections class (all classes really) should have nunit
tests before being admited into the tree. (I started hacking out code
for the dictonary nunit tests last night). In this case, I think that if we
write a test that just tests functionality for ICollection, and then add
another additional tests just for ListDictionary (for example), that
would work just fine.
> Maybe it'd be worthwhile to write NUnit test classes for interfaces like
> ICollection and subclass 'em for implementations like ArrayList or
> Hashtable. This is awkward, of course, since there's no multiple
> inheritance (for a class that implements IList and ICollection,
> but we might be able to figure out some sort of coherent approach.
See above. I don't think we need to subclass and reproduce the entire
functionality. Just run the ICollection tester against the object, and then
use a more specific class to test against ListDictionary.