try-catch-FAIL

Failure is inevitable

NAVIGATION - SEARCH

Entity Framework, Enums, and TINYINT

Entity Framework supports Enum properties on your model, but there’s one little gotcha that’s bitten me on more than one occasion now.  In your database, you may be tempted to save space by configuring the backing column to use an integer value that takes up less space than a normal int, such as a TINYINT (byte) or SMALLINT (short).  If you do though, you may get an error like the following: System.InvalidOperationException : The 'State' property on 'Issue' could not be set to a 'System.Byte' value. You must set this property to a non-null value of type 'IssueState'. It sounds... [More]

On Occam’s Razor and Refactoring

Continuing on with my ramblings from last time: refactoring is a powerful tool that can help you transition your application (solution) from the complex end of the spectrum towards the simpler end. More...

SpecsFor 4.3.1, SpecsFor<Web> Helpers 1.4.1 released!

I have two bug-fix releases for you tonight.  First, SpecsFor now supports partial matching on List types, including generic lists.  It works exactly the same as an array.  Here are the passing specs to illustrate what you can do now: [Test] public void then_it_does_not_throw_on_a_matching_pair_of_objects() { var obj1 = new TestClass { Name = "Name", Items = new List<NestedClass> { new NestedClass { Id = 1, Name = "One" } } }; Assert.DoesNotThrow(() => obj1.ShouldLookLike(() => new TestClass { Name = "Name", Items... [More]

Random Link Roundup–1/23/2015

Here’s the first official roundup of 2015!  In a few more years, perhaps you’ll be able to enjoy my roundups in pure holographic beauty! More...

On Occam’s Razor and Software Development

I had an epiphany of sorts the other day.  Maybe what I’m going to describe is obvious to everyone else out there, but it just “clicked” for me all of the sudden:  Occam’s Razor is foundational to our jobs as software developers. More...

Simple PowerShell Function for Publishing to NuGet

I’ve created a simple, re-usable function you can put in your PowerShell profile that will publish a package to NuGet or a local test feed.  This little script allowed me to remove redundant scripts that were scattered across my various projects. More...

Enforce Project Conventions Using NUnit and SpecsFor

Does your company or project have certain conventions that you are required to follow? Maybe adding a copyright header to each file?  Or using the correct layer super-type for all your controllers, context, etc?  I work on a *lot* of projects these days, and I often forget to follow some of these conventions in my day-to-day coding.  Fortunately, I have test cases that automatically check these conventions, and I get immediate feedback when I fail to follow them. More...

Introducing SpecsFor<Web> Helpers!

SpecsFor<Web> Helpers will help you write cleaner, easier-to-read (and maintain!) specs for your ASP.NET MVC applications.  It’s the latest addition to the SpecsFor family, and the first of the Helpers line that I’m working on.  Read on to see what it can do for you and your team! More...

Random Link Pile-Up

I’ve been so covered up with projects for the last month that I haven’t had time to post any useful links.  Like an angry, fire-breathing dragon with his loot, I have still been collecting all kinds of links.  There are too many for witty banter today, so all you get is a categorized list. More...

SpecsFor 4.3.0 RC 10 available!

Yes, that does indeed say “RC 10.”  The 10th iteration of 4.3.0 is now available as a pre-release package on NuGet.  Read on to see what’s changed with partial matching in this go-round! More...