Could Tests Be Written in Something Other Than MSTest

Jul 20, 2011 at 6:39 PM

Using MSTest for unit testing makes it difficult for those of us using an Express edition or mono. Is there any possibility that tests could be written in another framework?

Coordinator
Jul 26, 2011 at 8:02 PM

Yessir! Which framework should I use?

Jul 29, 2011 at 4:48 AM

I'm not religiously dedicated to any single tool but I think MbUnit is a good fit. It's attributes are very similar to MSTest, which makes migration easy. NUnit is very common, and supported by MonoDevelop, but it's a little behind the curve in terms of feature support (ordered tests via method dependency come to mind). Its test runner supports multiple unit testing frameworks as well, which again makes migration easy. Xunit.Net has some very interesting features, but it's a pretty serious departure from typical .Net unit testing frameworks. A good comparison is found here http://xunit.codeplex.com/wikipage?title=Comparisons&referringTitle=Home

Keep in mind however that you give up really tight Visual Studio integration. TestDriven.Net is a free plugin to non-Express versions of Visual Studio that integrates third part unit testing frameworks, but that still doesn't help the Express and Mono users. I don't know if a CodeRush works better with one framework over another. I realize asking you to give up Visual Studio tooling support isn't trivial.

Coordinator
Aug 5, 2011 at 4:31 PM

Cool. I would love for you to convert them. Can you fork the tests and put it into the platform of your choice? I would happily pull in the changes. Make sure you submit the pull request. Thanks!

Aug 6, 2011 at 6:30 AM

Sounds like a plan. I've started my fork and I've migrated CalculusTests and DecisionTreeTests. I think I will need to do some house work before it's mergeable though, I think my mercurial plugin affected the csproj files and mbunit.dll isn't included correctly. On a related note, Test_Decision_Tree_Invalid_Enum_Value failed because it didn't throw an exception, but it also fails in MSTest. I can't figure out why it's supposed to throw and exception though.

Aug 16, 2011 at 2:13 PM

I've migrated the tests in my fork (https://hg01.codeplex.com/forks/pnewhook/mbunittestconversion) but I can't yet open the solution in Express because of solution folders. I'm still working on that.