Question

I am trying to write some complicated acceptance tests for my C# code. I notice that when I am writing my tests I am doing a lot of explicit casting to satisfy the C# compiler. I like the type-safety I get in my production code with a statically-typed language like C#, but for my tests I would be happy to use a dynamically-typed language (e.g. IronPython or IronRuby) to avoid all the explicit casting. If my test calls a method that doesn't exist on an object, it would be OK for the code to fail at run time (it's just a failing test). I am currently using MS Test as my unit testing framework, and it would be convenient if I could continue to use it. What dynamic (DLR-based) language can I use that will integrate with MS Test? Feel free to suggest a different testing framework, if you think that would help.

Was it helpful?

Solution

I recommend IronPython -- among its advantages is the excellent book "IronPython in Action" which will lead you through every important aspect, including testing.

OTHER TIPS

I prefer C# for unit testing... If you are looking for dynamic language you can try iron-python for that....

For IronRuby and Rspec you could check out this post:

http://msdn.microsoft.com/en-us/magazine/dd453038.aspx

And http://msdn.microsoft.com/sv-se/magazine/dd434651(en-us).aspx for getting started with IronRuby .Net interop.

Then there is always fitnesse:

http://www.fitnesse.org/

Fitnesse .net 1.1 and 2.0 binaries can be found here: http://fitnesse.org/FitNesse.DotNet

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top