using Centron.Tests.EndToEnd.Infrastructure; using CentronSoftware.Centron.WebServices.Helper; using Xunit; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.TicketTests.Ticket140828; public class Ticket140828Tests : CentronTest { public Ticket140828Tests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } [Fact] public void TestCorrectRounding() { // In this ticket the problem was, that a receipt-item with the following values: // BasePrice: 23,7466666666667 // Discount: -50 // Precision: 2 // // Was rounded to 35,62 in our C# logic, and to 35,63 in our SQL logic var netPrice = ReceiptPriceHelper.CalculateNetPrice(23.7466666666667m, 2, -50, 1, false); Assert.Equal(35.63m, netPrice); } }