C# Dynamic keyword, and how you can use it to help TDD!


Just done some reading on the new dynamic typing stuff in .net 4 and it occured to be you could use this to assist using TDD “Test First” approach, where you write code to test methods that you’ve not yet written.  Unless you stub the method, you get compile errors, however using dynamic, the compiler doesn’t evaluate your call until run time, so your test will actually compile and you will get the expected red cross until you’ve actually implemented your method.  Turns out I’ve been beaten to this conclusion though; check out this post on Peter Gfader’s blog

  1. No comments yet.
(will not be published)