.NET Software Development Tutorials and Videos: C#, ASP, SQL Server, Linq, Visual Basic, Silverlight, Azure
Dealing With Singletons in .NET Unit Testing

Dealing With Singletons in .NET Unit Testing

This video discusses singletons, and when to use them.The Singleton is a well-known pattern in software. It’s got a lot of bad reputation too, since it makes testing more difficult. It has even come to being called “Evil”.

We also explore different testing scenarios, and different methods to deal with them, from complete rewrite, substitution with test doubles and using a mocking framework to fake them behind their back. Examples are shown in .NET C# in the glorious gray colors of VS2012.