.Net, Development Asp.Net Mvc, Log4Net, NLog, Project Nehemiah
One of my goals with the Nehemiah Project is to make sure the ASP.Net MVC 2 Application template is modular and extensible. What happens when MVC 3 is released? We certainly don’t want to lose all our hard work. What happens if you want to use a new or different ORM? The template should allow the user to easily replace existing components and add new components in either the template or the solution built from the template.
This may be very basic for many readers, so you can jump straight to the code below if you wish. If you know the how and why of interfaces, services, and dependency injection, by all means jump ahead.
Let’s begin by breaking down the parts of the Model-View-Controller framework. The Model represents our objects that are manipulated within our code. The View represents how our models are viewed. The Controller is the traffic cop that directs the flow of the models. So what manipulates our models?
.Net, Development Asp.Net Mvc, Elmah, Project Nehemiah
In this installment we’ll add support for our custom web errors and add support for Elmah.
Custom Web Errors
First we need to write our specs. In the Controllers folder of the Nehemiah.Specs project add a class file named ErrorControllerSpecs.cs. Initially we’ll write a single generic error page. So there will be only a single test. Our specs look like this. More
.Net, Development Asp.Net Mvc, BDD, MSpec, Project Nehemiah
In our last installment we converted the default tests to specifications for the Home and Account controllers. In this article we will be adding some meat to those specifications.
There are several good articles on the net about writing your specs. I stumbled across a couple more while preparing for this article. A reference list of all articles used in this post can be found at the end of the article.
There’s no need for me to repeat one of the best articles now. So go here, http://blog.wekeroad.com/2009/09/21/make-bdd-your-bff-2, and read this great post by Rob Conery.
The second article to read is http://telldontask.wordpress.com/2009/11/19/bdd-with-mspec-and-rhino-auto-mocks-part-2/.
We’ll combine what we learn in these two articles to write our specs. More