Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Unit test double values in c#

$
0
0
I have following unit test and  to calculate shipping cost ,I have a Calculate method that will return double value and am checking against hard coded value (1566.66666666667) and the test is failing. Can anyone guide me if this is the correct way of unit testing double values?


[TestMethod]
public void calculate_Test()
{
//Shipping class and calculate method
var amount=Shipping.Calculate(value1,value2,value3);

Assert.AreEqual(1566.66666666667, amount);

}



Viewing all articles
Browse latest Browse all 31927

Trending Articles