Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reference unit tests for common data structures?

I'm writing a class library that contains several specialized implementations of common data structures (lists, sets, dictionaries...). I find myself always writing the same unit tests over and over, and I'm never sure I'm not forgetting to test some important scenarios.

Since my classes all implement standard interfaces (IList<T>, IDictionary<K,V>, etc), I was wondering if there were some kind of "reference" unit tests that all implementations of these interfaces should pass. Of course I would also need to test the specific aspects of my classes, but at least I would be more confident that there is nothing broken in my implementation of the standard interfaces.

like image 704
Thomas Levesque Avatar asked Feb 13 '12 00:02

Thomas Levesque


1 Answers

You could have a look at the Mono unit tests on Github - there is at least Dictionary and IList tests there already.

like image 191
BrokenGlass Avatar answered Oct 23 '22 20:10

BrokenGlass