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: unit testing
Categories: Technical
a6223dc3-6d29-4e5e-9413-cfb3a465ee49|0|.0
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: httpcontext, unit testing, nunit, rhino mocks, watin, specflow, typemock, dependency injection
Categories: Technical
b66bdc53-0677-4f74-ac38-c1e2248c5374|0|.0
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: coding standards, refactoring, unit testing
Categories: Technical
a0e51b10-d39a-4e7f-ae0d-c48d42696eb2|0|.0
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: mvc
Categories: Presentations
d9723649-dda2-4dd5-8a36-3d0bf3e1ddad|0|.0
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
2a0060bc-e9e1-4393-97f9-3bb113dc2e4e|0|.0
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: unit testing, typemock, rhino mocks
Categories: Technical
e9f5c2cb-f4a7-4a11-8f98-ef9364f54982|0|.0
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: rest, mvc, wcf, jquery, json
Categories: Technical
c99501a7-073b-4295-ba9f-082ba5ddbeb3|1|5.0
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: unit testing, dependency injection, ioc
Categories: Technical
54801be3-3dab-4867-a37f-2ca10642051b|0|.0
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: unit testing, nunit, rhino mocks
Categories: Presentations
46bc5478-8587-4a0c-a241-de6d1e9864f9|0|.0
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: mvc
Categories: Presentations
433539c2-f89a-40e0-8a9a-7520b54b23b7|0|.0