I gave up on MS-Test 7 years ago. Back in 2015, my buddy George summed up our collective experiences working on the same project and deciding Why not MS-Test. Since that one project back in 2010, I’ve used xUnit in .NET projects.
Helping out with a project that uses MS-Test v.2, I was at least hoping things were better in that front. Silly me. For a framework that’s at least 15 years old, being in version 2 should cement my expectations pretty low.
In order to clean up some tests, as well as improve readability on them, I’ve created a baseclass to expose some things a specific group of tests share. As soon as I moved this class into a separate project, which would be referenced by other unit test projects in the solution, things broke down.
The error I was getting was specific to test methods that took in parameters in order to support DataRow (one of the things addressed by MS-Test v.2). In other words, a test like this would crash:
Searching around we found info on an issue with inheritance support for base classes that resides in different assemblies.
I tried using ILMerge to merge the two assemblies together (the unit test project + the TestUtils project). Worked fine on my machine. The build server wasn’t too happy with it, though. I used the MSBuild.ILMerge.Task NuGet package, which was compiled agains Microsoft.Build.Utilities.v4.0. Apparently, that introduces bigger issues.
In order to move on with life, we decided to include the file as a linked file so it can be reused in all unit tests projects that need it.