endpoint.tv Screencast - Spike on Workflow Managed Email Verification

Sign in to queue

The Discussion

  • User profile image

    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

  • User profile image

    Sure - I agree that writing a file during a unit test, creating directories etc is a little icky. :=0


    No wonder they call you Grumpydev... Wink

  • User profile image

    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

  • User profile image

    This video will be great if you don't  dig into detail of Testing & SMTP's.

Add Your 2 Cents