The answers are out-of-date. If the bug has been fixed, when, and in which versions of what assembly?
That s correct, it was fixed in VS2013 with the Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll assembly, version 10.0.0.0. Present in the legacy GAC, c:windowsassembly, it also has the 10.1.0.0 version.
There is a DLL Hell story here, the 10.1.0.0 version was the one used in VS2010. It had the bug, not properly checking for Double.NaN. Microsoft made a mistake, they fixed 10.1.0.0 but did not change the version number. So anybody that installed VS2010 after installing VS2013 is going to get hurt, it is going to overwrite the DLL with the buggy version.
Unraveling DLL Hell is never that simple, but it appears from the connect article and from the way it works on my machine that they identified the failure mode from the customer s complaint. And provided a fix, delivered in an update. Not clear which, after July 2014. You ll now use v10.0.0.0, the MSTest.exe test runner and the QTAgents have a .config file with a <bindingRedirect>
that redirects from 10.1.0.0 to 10.0.0.0 (not a typo). Be sure to obtain the latest update, currently 4. Look in Help + About if you are not sure what update you have installed.
For the record, the fixed code acquired specific checks for Double.NaN, it looks like this:
public static void AreEqual(double expected, double actual, double delta, string message, params object[] parameters)
{
if ((double.IsNaN(expected) || double.IsNaN(actual)) || double.IsNaN(delta))
{
string str = (string) FrameworkMessages.AreEqualDeltaFailMsg((message == null) ? string.Empty : ReplaceNulls(message), expected.ToString(CultureInfo.CurrentCulture.NumberFormat), actual.ToString(CultureInfo.CurrentCulture.NumberFormat), delta.ToString(CultureInfo.CurrentCulture.NumberFormat));
HandleFail("Assert.AreEqual", str, parameters);
}
if (Math.Abs((double) (expected - actual)) > delta)
{
string str2 = (string) FrameworkMessages.AreEqualDeltaFailMsg((message == null) ? string.Empty : ReplaceNulls(message), expected.ToString(CultureInfo.CurrentCulture.NumberFormat), actual.ToString(CultureInfo.CurrentCulture.NumberFormat), delta.ToString(CultureInfo.CurrentCulture.NumberFormat));
HandleFail("Assert.AreEqual", str2, parameters);
}
}