Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Steven Robbins

Steven Robbins Grumpydev

Niner since 2009

  • endpoint.tv Screencast - Spike on Workflow Managed Email Verification

    Lol, I'm well and truly self-titled Smiley

     

    It is good to see samples like this. We recently had a WF4.0 talk at the user group I run and it really made me ask myself why the hell we weren't looking at using it in almost EVERY app we were writing. Even for relatively simple tasks like email verifications, having WF handle reminders, flagging of unactivated accounts etc is just so much less hassle to implement, and even more of an advantage if those rules need to change.

     

    Your unit test still stinks though Wink

  • endpoint.tv Screencast - Spike on Workflow Managed Email Verification

    Nice idea to show something that a lot of web apps will have, but probably don't currently leverage WF for. I also like the idea of the static method to remove any of the WF "plumbing" from the main code.

     

    Really don't like your test though. Having the SmtpClient and the file system as a dependency is pretty nasty in my book. Although you probably kept it that way to make sure you didn't over complicate the demo, I think it's worth pointing out that's probably not a very "good" test for the real world Smiley

     

    Personally I'd create an ISendService, add an ISendService public property to the CodeActivity (defaulting to a concrete version that uses SmtpClient) and add another overload to Invoke to accept an ISendService. You can easily then create a fake in your test (statically or dynamically) that makes sure the "Send" method is executed correctly without taking on any other dependencies.

     

    Like I said, it probably over complicates this demo, but I thought it was worth pointing out Smiley