ASP.NET MVC View Best Practices – Keep logic out of your views
When it comes to views in ASP.NET MVC, you won’t be short of options how you decide how to create them. One of the easiest mistakes is to implement logic in their views. It’s no surprise developers such as Rob Conery have advised against having conditional code in ASP.NET MVC views. Before you know it [...]
ASP.NET MVC Controller Best Practices – Skinny Controllers
No blog post can cover ASP.NET MVC controller best practices in one go. So this is the first post in a series about ASP.NET MVC controller best practices. In this post we’re looking at why your ASP.NET MVC controllers should be ‘skinny’. The code used in this post can be downloaded here. I’ve heard Jeffrey [...]
How to Unit Test ASP.NET MVC Controllers
Given one of the major advantages ASP.NET MVC has over traditional ASP.NET web forms is testability, it’s surprising how many code samples in books and on the web don’t cover how to unit test controllers. There are also many examples of unit tests for ASP.NET MVC controllers that don’t do enough, or do to much. [...]
How AutoMocking and RhinoMocks could change how you write unit tests
One of the biggest headaches when it comes to unit tests and test driven development is having to modify existing tests when a constructor changes even if they don’t need to use the newly injected object. For an introduction to RhinoMocks check out How to write better unit tests using RhinoMocks and stubs. You might [...]
Did you know NUnit 2.5 is out?
Go to http://www.nunit.org/index.php?p=download to get it! It has awesome new features such as data driven tests! See http://nunit.com/blogs/?p=66 for more information. That means I can now do the things only possible before in other frameworks such as MbUnit and xUnit. Just be aware if you write your asserts like this Assert.That(1, Is.EqualTo(1)); ‘Is’ is now [...]
« go back — keep looking »