Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a library of default unit tests for .NET interface implementations?

For example, I have a type which implements IDictionary, and I need test coverage to ensure that it does it properly. I just wondered if there is a repository of standard, reusable tests for this kind of thing anywhere; if there isn't, I might create one.

like image 274
Mark Rendle Avatar asked Jul 14 '11 14:07

Mark Rendle


1 Answers

I doubt there's a publicly available .net one, but the Mono project might be a good place to start?

Whether they're testing "the contract" of the interface, or the specific implementation, I'm not sure, but there's certainly tests for the Dictionary class:

https://github.com/mono/mono/blob/master/mcs/class/corlib/Test/System.Collections.Generic/DictionaryTest.cs

like image 57
Steven Robbins Avatar answered Nov 15 '22 19:11

Steven Robbins