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!

Advertisements

Trackbacks & Pingbacks

Comments

  1. * Jo says:

    A good resource for Unit Testing ASP.NET

    http://www.typemock.com/ASP.NET_unit_testing_page.php

    (with the ‘AAA’ approach: Arrange, Act, and Assert)

    A tutorial on Test Driven Development http://www.typemock.com/Test_Driven_Development_TDD.php

    | Reply Posted 8 years, 5 months ago


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: