I can’t help it…

4 commentsWritten on July 25th, 2008 by
Categories: Off Topic

but i think this is cool:

        [Test]

        public void DisposesRequestProcessorUponDisposal()

        {

            requestProcessor.Expect(r => r.Dispose());

            requestProcessor.Replay();

 

            dispatcher.Dispose();

            requestProcessor.VerifyAllExpectations();

        }

i know... i know... total geek.

  • kve

    cool man!

    what is it?

  • http://davybrion.com Davy Brion

    i would think (hope) that it’s pretty obvious…

  • HardTime

    I think the r => r.Dispose() is the hard part. I do think it’s obvious, although … maybe not pretty obvious ;-) . But yeah, pretty cool.
    Type inference in C# (3.whatever) sucks big time b.t.w., ( r being an inferred Request class I guess, I’m still on 2.0 … ) either go all the way, or don’t do it at all, is my opinion. I think ambiguity should be avoided, unless it enriches the language, as for instance the ambiguity of multiple inheritance does. The C# sharp guys haseem to miss this point on multiple occasions. MS’s current infatiation with functional languages that seeps through in their own implementation does not do justice to the origanal ideas. Check out Scheme, Haskell, or Lisp.

  • HardTime

    And check out the Nomad pattern while you’re at it… It blew my mind.