unit testing
There are 5 entries for the tag unit testing
Test Data Builder Pattern When unit testing we often need to fill any POCO objects with enough data to satisfy the needs of the test. Redoing this in every test can quickly become a burden and slow down the testing process. Test Data Builder is a pattern that’s meant to help in just that situation. With test data builder you build a fluent interface that allows you to build out your POCO objects by only replacing the properties that you need specific values for. The other values are set to defaults...
When testing in ASP.NET MVC3, one of the common elements you might want to test is authorization. Although the framework does most of the heavy lifting for ASP.NET Membership and authorization it is still worthwhile to be able to write a test to show that the proper Authorization tag is in place. You might think that it’s as easy as calling the method on the controller with a proper context, but that’s not the case. When you call the methods directly on the controller the authorizations are skipped....
This week I had a need for NUnit based unit testing against a class that depended on a provided SqlConnection. Up to this point I had been able to mock external objects and their behavior based on interfaces, but with a SqlConnection I could not mock. There are some options for mocking the SqlConnection such as TypeMock, but I needed a realistic connection to test against. This also proved as a good method for building the expected DB interface. The solution that worked best for my environment (only...
Programming Visual Basic applications? Typemock have released a new version of their unit testing tool, Typemock Isolator 5.2. This version includes a new friendly VB.NET API which makes Isolator the best Isolation tool for unit testing A Visual Basic (VB) .NET application. Isolator now allows unit testing in VB or C# for many ‘hard to test’ technologies such as SharePoint, ASP.NET MVC, partial support for Silverlight, WPF, LINQ, WF, Entity Framework, WCF unit testing and more. Note that the first...
A while back I made a post about the Joel test and how badly my current employer is doing according to it. I've made it a personal goal to help improve my working conditions here as long as I am employed here, and as such I've started tackling weak areas, namely beginning with implementing source control management (SCM). As I've mentioned in my year wrap-up, we've made great progress in this department. I no longer write code unless I've first created a repository. For older jobs, as I use and update...