Fluent.Interface


TDD on show with ASP.NET MVC at Mix09

Its been a long road, but ASP.NET MVC 1.0 is out and now is open source as posted on ScottGu’s blog.  Its a great milestone and one that has been paraded in front of the the Mix09 attendees in Vegas.  I can recommend setting aside the two hours required to get through Phil Haack‘s Nija preso, and Scott Hanselman‘s NerdDinner talk.

Those guys along with Rob Conery and the main man Scott Guthrie have been slaving away on a new book ASP.NET MVC 1.0 from wrox press.  

the extended forehead edition

And have been kind enough to give away from free a chapter that walks through all the steps required to create the NerdDinner sample, which includes details on:

  • Validation
  • Security tips
  • Rendering partial controls
  • Custom routing
  • Authentication/Authorization
  • AJAX (with jQuery).
  • LINQ to SQL mapping with scalar/table MSSQL functions (very cool!) 
  • Dependancy injection with MOQ

It also has 20 pages dedicated to Unit testing, and encourages using the ‘AAA’ approach: Arrange, Act, and Assert which looks like this:

[TestMethod]
public void Dinner_Should_Not_Be_Valid_When_Some_Properties_Incorrect() {
//Arrange
Dinner dinner = new Dinner() {
Title = "Test title",
Country = "USA",
ContactPhone = "BOGUS"
};
// Act
bool isValid = dinner.IsValid;
//Assert
Assert.IsFalse(isValid);
}

PhilHa and ScottHa also spend a good amount of time covering red/green/refactor in their videos, and why it is important to have the test fail first.  Great Stuff!