Floating point numbers (Single / Double) must be tested with a valid value. So you can tell if two numbers are within 0.0001 (tolerance) of each other, consider them equal
In NUnit, you are comparing. for example the following AreEqual overload, find the equivalent for MSTest ..
Assert.AreEqual( double expected, double actual, double tolerance,
string message );
Update: This should be the method you need in MSTest. Try to check if your problem fixes.
Gishu source
share