Behavior Driven Development with SpecFlow + WatiN + DryRunner

In the previous post, we examined some of the principles behind BDD.  If you read it, I'm sure you're thinking, "Wow! That's great! But, how do I accomplish this in Visual Studio?"  There are a myriad of posts on the Internet that demonstrate different components.  However, there's not really a single post with all of the information compiled.  For that reason, I'm going to provide a step-by-step tutorial on how to perform BDD with Visual Studio. Additionally, I will show you how to perform automated testing using your Gherkin scripts.

Read more


Behavior Driven Development Principles

According to AgileAlliance.org:

BDD (Behavior Driven Development) is a synthesis and refinement of practices stemming from TDD (Test Driven Development) and ATDD (Acceptance Test Driven Development).

That's great, but what does that really mean?

BDD has its roots in TDD, but supersedes TDD in the agile development process.  BDD recognizes that User Stories are the framework for the development process and that these stories determine the necessary tasks required to satisfy given business requirements.  Read more


Moving Hyper-V to Azure

This past week I needed to move a client's Hyper-V machine to a Windows Azure VM.  If you haven't figured it out already, the process isn't as straightforward as one may hope - especially, since there's a rather large chasm between the new and old Azure management portals as neither offer an entire end-to-end solution.  As with most things Microsoft nowadays, PowerShell seems to be the best solution for truly accomplishing your needs.

Below, you'll find a resource for tackling all of the different components of moving a Hyper-V VM to Azure.  There are some ways to do parts of this through the various GUI's, but, again, none of the GUI's offer a complete solution.

Read more


Using OLEDB with SQL Native Client

This week, while moving a client's VM to Windows Azure, I was also required to upgrade their database from SQL 2005 to SQL Azure.  While not extremely difficult, there were a few gotcha's along the way.  These "gotacha's" were primarily features that had been deprecated.  Those deprecated features aren't the purpose of blog post, however.  This post is addressing a connection string issue.

Read more


Why Unit Test?

As a Microsoft Certified Trainer over the past 2 years, I've had the opportunity of teaching hundreds of professionals how to properly engage in unit testing.  Amazingly enough, even though unit testing has been around quite a while, it is still a concept that is very infantile in the corporate arena.  Most developers who have adopted unit testing are those who work for start-ups or the few companies who've started to embrace agile methodologies executing test-driven development (TDD).

Read more


Enabling Web Deploy Publishing With Visual Studio 2012

So after a few hours of trying to figure out how to publish my MVC project in Visual Studio 2012 to my web server running Microsoft Server 2012, I finally got it working.  I know there's a lot of other blogs out there, but in order for me to get it working, I ended up having to take bits and pieces from multiple blogs and MSDN articles.  So, I decided to compile what I've learned and share here on my blog.

Read more


Custom Validation Errors in MVC

There are times where you may want to display custom validation error messages in MVC.  As for me, I'm not a huge fan of the classic ValidationSummary HTML helper.  I will still annotate my data model, but I want the errors to have a better presentation in the UI. Occasionally, I may want to display one error at a time.  In order to do all of this, there's a few steps that need to be implemented.

Read more


Render HTML in a Validation Message in ASP.NET MVC

Often times you may want to render a custom validation message that contains HTML markup.  If you simply add the line:

@Html.ValidationSummary()

This will encode the markup so that less than signs and greater than signs are rendered < and >, respectively.  This, of course, is not what you want.

To render your HTML markup, its a little dirty, but it does work.

Simply add the following to your view:

@Html.Raw(HttpUtility.HtmlDecode(Html.ValidationMessageFor(m => m.Email).ToHtmlString()))

Where "Email" is a property of your model.


FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure'

When deploying an MVC application to a hosting environment you may receive the error:

[FileNotFoundException: Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]

This is also one of a few component libraries that are needed for deploying an MVC application:

  • System.Web.Helpers.dll (required by the web.config)
  • System.Web.Mvc.dll
  • System.Web.Razor.dll
  • System.Web.WebPages.dll
  • System.Web.WebPages.Razor.dll
  • Microsoft.Web.Infrastructure.dll

The system libraries are installed with .NET 4, however, 'Microsoft.Web.Infrastructure.dll' is only installed when Visual Studio is installed on the machine.  Therefore, short of needing to install MVC and Visual Studio on a production environment, we need to deploy the libraries with out application - and we'd like to do so automatically.

There are a few ways to automatically deploy the 'Microsoft.Web.Infrastructure.dll' component library with your application.  The steps depend on which version of Visual Studio you are using.

Read more


WMI Firewall Exception for Team Foundation Reporting Server 2012 in Virtual Environment

While installing TFS 2013 in a Windows Server 2012, I was having issues getting the TFS Application Tier to connect to WMI on the Reporting Server. Being that I’ve installed Team Foundation Server 2010 and 2012 countless times, I was sure that all of my settings were correct. Therefore, I predicted that this must be a firewall issue…and I was correct.

Read more