using System.Linq;
using Centron.BusinessLogic;
using Centron.BusinessLogic.WebServices.Sales.Receipts;
using Centron.Interfaces.BL;
using Centron.Tests.EndToEnd.Infrastructure;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.TicketTests.Ticket167799;
public class Ticket167799Tests : EndToEndTest
{
private const int CustomerI3D = 10022;
private const string OpenTransOrderXml = @"
IT-167799
2026-06-15T10:00:00
buyer
Testkunde
Teststrasse 1
97070
Wuerzburg
Deutschland
delivery
Testkunde
Teststrasse 1
97070
Wuerzburg
Deutschland
true
00001
BUNDLE-167799
100000167799
Notebook Bundle
bundle
NOTEBOOK-167799
1000001677991
Notebook aus Bundle
NB-167799
component
1
C62
SETUP-167799
1000001677992
Grundeinrichtung aus Bundle
component
1
C62
2
C62
850.00
standard_rate
VAT
0.19
161.50
1700.00
1
1700.00
";
public Ticket167799Tests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
using var session = new BLSession();
var order = session.GetBL()
.CreateOrderFromITscope(CustomerI3D, null, null, OpenTransOrderXml, this.GetLoggedInUser().User)
.ThrowIfError();
var notebookItem = order.Items.Single(f => f.ManufacturerCode == "NB-167799");
var setupItem = order.Items.Single(f => f.Text?.Contains("Grundeinrichtung") == true);
Assert.Equal(2m, notebookItem.QuantityComplete.GetValueOrDefault());
Assert.Equal(2m, setupItem.QuantityComplete.GetValueOrDefault());
}
}