About the author

Steven Harmansteven harman :: makes sweet software with computers!

For recent posts and more about me, scroll to the bottom.

Subscribe

  • Subscribe to my feed. via RSS
  • Subscribe via email via email

News

Badges

  • Subtext Project
  • Support Subtext

tdd

There are 8 entries for the tag tdd

Prefer Dependency Injection to Service Location

There is currently a thread running over in the StructureMap Users mailing list asking if we really need constructor injection when using an Inversion of Control container. Before any one rips off on a rant let me say that I worked with Jon in my former life and I’m fairly certain he’s merely conducting a thought experiment, trying to sure up his own beliefs. A worthwhile exercise, if you ask me. At any rate, I have a few points I wanted to throw out there; most of them basic and mere reiterations of the words of others… but I’m...

Toward a Better Use of Context/Specification

If you’ve hand-rolled your own Context/Specification apparatus to support your test spec-first lifestyle, you’ve likely got a base class that looks something like the following: 1: public abstract class concerns 2: { 3: [SetUp] 4: public virtual void setup_context() 5: { 6: context(); 7: } 8:...

Saving the World via… TDD?

Hot on the heels of my wildly (in)famous “When Should I Write Tests?” post, I have another fun tidbit about testing to share with you. Though, to be honest, I found this gem via my buddy Scott C Reynolds, so I can’t take all – actually, I can’t take any – of the credit. Anyhow, Scott posted a great little snippet of code that does a couple of things: Shows the gist of Context/Specification style specs in use. Ensures we won’t need John Connor’s help after all. ...

When Should I Write Tests?

That is a question I get quite a bit, albeit in a variety of different flavors, but the heart of the question is always the same. So, inspired a conversation with my friend Corey, and a certain talk from a recent Ruby Hoedown that he told me about, I decided to clear up the issue once and for all. And to make it perfectly clear, I decided to register some new URLs that are easy to remember: http://whenshoulditest.com http://howoftenshoulditest.com Go give them a read, I think you’ll get...

The Easy Way to TDD

Interested in getting started with Test-Driven Development but not sure where to start? Fear not! Get you some! That's right, you can now get your TDD at the front desk of your local Crowne Plaza. Wait... what do you mean its not that kind of TDD? I saw this sign in the hotel lobby during my recent trip to the West Michigan Day of .Net, I swear! Tim and James saw it too, just ask 'em! Technorati Tags: tdd, dayofdotnet, funny

Expectation Based Testing with Mocks

Last week I talked about Rubifying your C# code by adding the .Each() extension method to the IEnumerable<T> interface. I was discussing that code with one of the guys at work and he asked a brilliant question So, how did you test that? I was floored. Being such a test-first fan boy I couldn’t believe that I had failed to write that little extension method in a TDD manner. Hell, I hadn’t even done TAD! So how do I test it? There are no doubt a plethora of ways to test this...

TDD + DI + ASP.NET MVC Made Better with StructureMap's Fluent API, Oh My!

My God... could I put any more acronyms in that title. Yeah, I probably could. Oh, and if you just came for the code, jump to the bottom. In his post TDD and Dependency Injection with ASP.NET MVC, Phil used a DI framework to reduce friction and increase his Test-Fu when doing the TDD thang. How do you up your Test-Fu? By pushing the monotonous, and sometimes overbearing, work of wiring up dependencies off to a tool - in this case, a Dependency Injection tool called StructureMap. Angle bracket madness Phil was good enough to...

Hotfix KB928388 - Revised Daylight Savings Time

Today I was merging the Subtext 1.9 branch back into the trunk in our SVN repository and I came across an interesting "Gottcha" to keep in your back pocket - Microsoft has changed the Time Zone settings with the fix for KB928388. The Back Story One of the great things that Subtext has going for it (from a developer's perspective) is our great suite of Unit tests. At the time of this writing we were up around 39% code coverage. So, being the contentious developer that I am, after I merged the branch into trunk and cleaned up any...