Jun 07
Eric.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?
More
May 31
Eric.Net, Development Asp.Net Mvc, Nehemiah Project
In part 13 in the Nehemiah Project series we’ll complete the Custom Profile Provider. The profile provider is a generic storage feature and gives our web application the ability to store unique user information. In the profile we can store such items as a web layout, color scheme, zip code, or billing and shipping addresses.
Then why write the custom profile provider. Well, to give us options. If you don’t like the way the SQLProfileProvider stores data you now have your own method. Or if you need to retrieve the data from an existing database or service you have an example of writing the specs and an implementation that can be modified to suit your needs. More
May 24
Eric.Net, Development Asp.Net Mvc, Nehemiah Project
We began writing the custom role provider in part 9 of this series. In today’s post we’ll finish what we started in part 9. This will be nearly all code and no fluff commentary. Ok, maybe a little commentary.
When I initially ran through this exercise I had a separate repository for User, Role, and UserInRole. Which I felt was a bit ridiculous since these three will almost always be used together and I didn’t feel the need to pass a separate repository for every POCO that might be read or modified from our data repository. So I merged all of them into the IProviderRepository interface. These are the kinds of things you run into as build and learn as you go. More
May 17
Eric.Net, Development Asp.Net Mvc, Nehemiah Project
In part 8 of this series we began creating a custom Membership Provider. We’ll finish our custom Membership Provider with this post. This entails expanding our specifications, finishing our membership provider code, and writing a mocking class for our data repository. More
May 10
Eric.Net, Development Asp.Net Mvc, Nehemiah Project
This is the third post on adding custom providers to our MVC2 template project. This post will simply setup the skeleton specifications and code for our own custom profile provider.
Add a class file named ProfileProviderSpecs.cs to the Providers folder in the Nehemiah.Specs project. Here’s our specifications for the custom profile provider. More
May 05
Eric.Net, Development Asp.Net Mvc, Nehemiah Project
In this installment we’ll add the specifications and the skeleton code for a custom role provider. Start by adding a class file to the Providers folder in the Nehemiah.Specs folder. Give the file a name of RoleProviderSpecs.cs.
Here is our skeleton custom role provider. Just like the membership provider, these specs will be expanded upon in the next post about the custom role provider. More
May 03
Eric.Net, Development Asp.Net Mvc, Nehemiah Project
This post will be more code than explanation. As will the next two posts. I want to get an outline of the code necessary to build our own custom membership, role, and profile providers. Once we have the outline, then we’ll expand our specifications, write our code, and we’ll probably need to add Ninject into the mix during this and the next five or six posts. More
Apr 26
Eric.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
Apr 19
Eric.Net, Development Asp.Net Mvc, MSpec, Nehemiah Project
Summary
In this post we’ll finish converting the auto-generated tests to MSpec specification.
Automate Running MSpec

If you wish to automate the running of the MSpec tool, open the properties to the Nehemiah.Specs project. Add the line below to the “Post-build event command line:” field. Now when Nehemiah.Specs builds successfully, MSpec will run automatically.
C:\_CodeVault\MSpec\mspec.exe $(TargetName)$(TargetExt) –html “$(ProjectDir)Report.html” More
Apr 15
Eric.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
Older Entries Newer Entries
Recent Comments