We begin code camp with
Terry Thibodeau and mock objects, hopefully with a notable lack of french kissing content.
Terry's choice of a casual "I sleep in this" shirt is an unfortunate and unusual style choice for him. However, he has earned instant credibility in my eyes from two things:
a) his preference of Rhino Mocks over NMock
b) his
Tony Almeida soul-patch goatee - seriously, I don't think anyone here aside from say, yours truly, can top that level of sass. I'm glad Jonas isn't here or he would be dry-humping Terry's chair.
Mock objects came from the TDD world - help to isolate your testing and testing object ineraction vs. your state.
Is Terry going to actually drink an *entire pitcher of water* up there?
Terry sets up an MVP pattern, complete with a mock view. Terry remembers to use the all important Mocks.ReplayAll(). I once heard a story about a developer so retarded that he and his team spent a good amount of time trying to debug a mock only to find out that he forgot about ReplayAll()*. Who hires guys like that anyway?
Terry, seemingly like everyone at this conference, is using Resharper to run its unit tests. Man, this coffee was good stuff. JOY Hey, Resharper, I'll do presentations just on how great Resharper is if you can hook me up with a license!! Is anyone listening??
Terry prefers RhinoMocks to NMock because any problems with the mock load will be caught at compile time, vs. NMock where the mock problem will be caught at run time (due to their typing). Terry Thibodeau is a LIAR. I happen to know that like me, Terry prefers RhinoMocks to NMock because the word "Rhino" is there. "Rhino" conveys *POWER* and virility. What the hell does "N" convey? WUSSY. That's what it conveys. Think about it. You're at the bar and trying to score a quick hookup and some girl asks you what you do your unit testing with. Which sounds better? NUnit...or RHINOUnit? Case closed.
Man, that coffee WAS AWESOME. I feel like I'm flying!! Oh my goodness - I finally understand what it's like to be Steve Rockarts!!
The guy behind me says "Setup and Teardown, hey?" and cackles to himself. These Calgarians are a little too enthusiastic about their unit testing.
Terry is obviously from the
JP Boodhoo school of presentation as he has an entire pitcher of water beside him and drank none of it. JP asks me for my agenda. I already gave it to him!! Where is it? Now he's grinning. I'm suspicious that JP has *stolen* my agenda of today's events, but I can't prove it. But why!?!? What is JP's diabolical master plan? How does it involve me? Or does it just involve my shirt? Is he laughing at me over there? Holy crap, is that a DRAGON over there? I'M NOT PARANOID
Mocks are awesome but presenting on them is sometimes hard because of additional concepts surrounding it. You definitely require a knowledge of unit testing or TDD (which really isn't that difficult a concept to grok) but in this presentation it also requires everyone to be able to figure out MVP (again, not too bad but if you were new to it I could see confusion). Terry has done a pretty good job considering there's a lot to cover when you are also throwing the MVP pattern at devs. Terry elucidates on the benefits of mocking: you are testing explcitiyl to your interface, it helps you isoalte code, and then you are truly testing your actual code rather than also having to worry about your stub objects.
Although NMock and RhinoMock have the difference Terry alluded to earlier, TypeMock is even more different given it's not designed with TDD in mind, unlike the other two.
And of course, it wouldn't be Calgary Code Camp if I didn't
summarize this event in poetry...
This presentation was cool, Terry's soulpatch is hot
"Rhino" tools rule, while "N' tools do not
Mocking and coffee make me feel like I'm high
My only question is WHY JP WHY?
* said developer might have been yours truly