Category Archives: C#

Testable object wrapper

Have started experimenting with a way of wrapping the ‘system under test’ in a wrapper-class that also contains the mocked dependencies. The class is instantiated the same way as Brad Wilson’s Testable Object Pattern with a static Create method. The big differenceĀ from his pattern is that the system under test is a public Sut-property instead […]

Create Html.DropdownListFor without magic strings

Using magic strings are bad practice. Changes could lead to code compiling but containing lots of errors (appearing during runtime). And refactoring your code is a lot harder if you have to globally search and replace. Using dropdown lists with ASP.NET MVC has a Html-helper that wants you to use magic strings. Having a Category […]

Category: C#