Using the Should assembly for testing

Posted by Joe Wilson on Monday, August 23, 2010 7:30 AM

Should is a .NET assembly of extension methods for building easy to write and easy to read assert statements.  The advantage of using this assembly is the syntax is more clear and more like human language.  It's free, open source, and it doesn't matter if you're using NUnit or MSTest or any test runner (Test Driven .NET, ReSharper, etc.).  The project is in Beta 1.1, but I've used it on a couple of projects now with no problems. I've never really liked the MSTest way of doing an ... [More]

Tags:
Categories: Technical


kick it on DotNetKicks.com shout it on DotNetShoutOut

Don't mock HttpContext

Posted by Joe Wilson on Thursday, August 19, 2010 6:40 PM

He doesn't like to be mocked! It's so easy to take a direct dependency on HttpContext and not even realize it.  If you're in the code behind in Web Forms or in a controller action in MVC, it's just right there, tempting you to use it to access session variables, application security, etc. But don't. Some little known facts about HttpContext: HttpContext is the largest object ever created by humans. If you printed out the code for everything in HttpContext, the pages could be sta... [More]

Tags: , , , , , , ,
Categories: Technical


kick it on DotNetKicks.com shout it on DotNetShoutOut

Do we still need coding standards?

Posted by Joe Wilson on Tuesday, July 6, 2010 6:31 PM

The dark ages I used to be really big on coding standards in the late 1990's.  It was so easy to slip into spaghetti code in classic ASP and VB6, and at the time, the best antidote was rigid standards and uncompromising code reviews.  I was a hard ass about our coding standards.  Then, as now, the rationale was that coding standards would make the code easier to read and maintain in the inevitable and long maintenance phase. The development process we used at the time was to s... [More]

Tags: , ,
Categories: Technical


kick it on DotNetKicks.com shout it on DotNetShoutOut

Presentation: What's New in MVC 2?

Posted by Joe Wilson on Wednesday, May 12, 2010 12:35 PM

Thanks to all the folks who attended the South Colorado .NET User Group Visual Studio 2010 launch on May 6th.  We went through a giant buffet of new things in Visual Studio, Entity Framework, SharePoint, Silverlight, and ASP.NET.  Slides from my talk on the new features in MVC 2 can be downloaded here. Big thanks also to Ben Hoelting for putting the event together.  I liked the mini code camp format!  It was a lot of info, but it was a great survey of most of the new featur... [More]

Tags:
Categories: Presentations


kick it on DotNetKicks.com shout it on DotNetShoutOut

INETA Community Champion

Posted by Joe Wilson on Tuesday, April 6, 2010 3:00 PM

I got an email this morning telling me I won an award as an INETA Community Champion.  Cool!  Other winners this year and past winners are listed on their site. I really appreciate the recognition for speaking at local user group events and helping out.  Thanks to Julie Yack for nominating me and for her support!

Tags:
Categories: General


kick it on DotNetKicks.com shout it on DotNetShoutOut

Unit testing untestable code

Posted by Joe Wilson on Tuesday, April 6, 2010 1:44 PM

Let’s say you’ve got a static or sealed class, or a class with non-virtual members that your code needs to use.  You need to unit test your code, but you can’t get an instance of this class and/or you can’t mock it.  There are two ways to go: Buy a tool that let’s you mock things like this, such as Typemock Isolator or the newly announced Telerik JustMock. Code around it. Buy it I’ve already compared Typemock Isolator ($799) to RhinoMocks (free).  Typemock Isolator wor... [More]

Tags: , ,
Categories: Technical


kick it on DotNetKicks.com shout it on DotNetShoutOut

REST-like behavior with MVC instead of WCF

Posted by Joe Wilson on Sunday, March 7, 2010 6:16 PM

WCF is a very cool framework for adding an abstraction layer over your services.  You can have .asmx, .svc, and now, REST URLs with no extension.  These endpoints can even return JSON to the caller, which is useful if you’re using jQuery or another JavaScript library. The knock on WCF?  The configuration story!  It’s getting better in WCF 4, which is scheduled for release in a month or so.  It will have a bunch of defaults so you don’t have to be as explicit in your con... [More]

Tags: , , , ,
Categories: Technical


kick it on DotNetKicks.com shout it on DotNetShoutOut

Increasing Testability

Posted by Joe Wilson on Sunday, March 7, 2010 4:30 PM

Testa-what? I don't know if "testability" is a word, but if Bud Light can make up "drinkability", maybe it should be.  I'm talking about how pliant your code is to testing.  If you're doing TDD or BDD, the code you write is testable by definition.  But if you're going the other way, and coding first or testing legacy code (any code not already under test), you've probably run into code that was hard to test and felt like giving up.  Some of the most common hurdles for test... [More]

Tags: , ,
Categories: Technical


kick it on DotNetKicks.com shout it on DotNetShoutOut

Presentation: Unit Testing and Mocking with NUnit and Rhino Mocks

Posted by Joe Wilson on Sunday, February 28, 2010 2:57 PM

Thanks to the folks who came out for my talk on unit testing and mocking with NUnit and Rhino Mocks at the Rocky Mountain Tech Trifecta.  I really appreciate all the comments and questions.  I was also really stoked to hear it helped some of you get over that unit testing hurdle. The slides and code can be downloaded here.

Tags: , ,
Categories: Presentations


kick it on DotNetKicks.com shout it on DotNetShoutOut

Presentation: Intermediate ASP.NET MVC - Part 2

Posted by Joe Wilson on Friday, February 19, 2010 3:27 PM

Thanks to all those who came out for the Denver Visual Studio User Group lab for more ASP.NET MVC fun! The slides, labs, and code can be downloaded here.  I've also included some quick starts\cheat-sheets as handouts.

Tags:
Categories: Presentations


kick it on DotNetKicks.com shout it on DotNetShoutOut

Image Details