I'm learning VS Unit test and tried this:
[TestMethod()]
public void calcTest()
{
double expected = 1.234F; // TODO: Initialize to an appropriate value
double actual;
actual = 1.234F;
Assert.AreEqual(expected, actual);
Assert.Inconclusive("Verify the correctness of this test method.");
}
When running this test method, it says inconclusive ??? Why ?
Update: Hi Guys ok to tell don't compare floats but Business Requirements are what they are so what should I do if I need to compare them ?
Do you mean it's impossible to test floating calculation without headache ? Then if testing is such a headache in financial calculation isn't it better to not do testing at all ?
Seems like a huge bug or design flaw in vs test framework rather :) as it is said here http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.assert.inconclusive%28VS.80%29.aspx
Indicates that an assertion cannot be proven true or false.
Since I compare 2 same litterals sure it is true !