We have the following test:
[TestMethod]
public void TestSettleOrdersPost()
{
// Invoke
FormCollection form = CreatesettleOrdersPostFormCollection();
var viewResult = unconfirmedOrderController.SettleOrders(form) as ViewResult;
var ordersFromView = (IEnumerable<Order>)viewResult.Model;
// Assert
Assert.IsInstanceOfType(ordersFromView.ElementAt(0).UnitPrice, typeof(Decimal),
"Unitprice should be a decimal");
Assert.AreEqual(4.00M, ordersFromView.ElementAt(0).UnitPrice,
"The unitprice should be updated to 4.00");
Assert.AreEqual(true, ordersFromView.ElementAt(1).IsConfirmed,
"The item should also be set to confirmed");
}
private static FormCollection CreatesettleOrdersPostFormCollection()
{
FormCollection form = new FormCollection();
form.Add("item.OrderId", "1");
form.Add("item.UnitPrice", "2.00");
form.Add("item.OrderId", "2");
form.Add("item.UnitPrice", "4.00");
return form;
}
This test works like a charm locally, but when we use the Jenkins build server we get the following error message:
MESSAGE:
Assert.AreEqual failed. Expected:<4,00>. Actual:<400>. The unitprice should be updated to 4.00
+++++++++++++++++++
So somehow someway in the UnitPrice
the decimal point .
is converted to a ,
. How can we also make it turn into a .
on Jenkins?