Using the standard dispose pattern as described, e.g., in http://msdn.microsoft.com/en-us/library/fs2xkftw(v=vs.100).aspx fixes the problem. That is, replace private void Dispose(bool disposing)...
by protected void Dispose(bool disposing)...
.
The problem is related to fact that MSTest (I tested Visual Studio 2010 and 2013) does call dispose on the test class after each tests. To this end, MSTest queries all public void Dispose
functions but unfortunately ignores the argument, which is the part of the function signature that distinguishes your two variants. As a result, MSTest exists with Ambiguous match found
.