QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142) getrackt, ohne .gitmodules und ohne erreichbares Remote. Der Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen. Umstellung: - Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6) - Gitlink aus dem Index entfernt - Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
59 lines
2.0 KiB
C#
59 lines
2.0 KiB
C#
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Data.WebServices.Sales.Receipts.Offers;
|
|
using Centron.Interfaces;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.TicketTests.Ticket139506;
|
|
|
|
public class Ticket139506Tests : EndToEndTest
|
|
{
|
|
public Ticket139506Tests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public const int CustomerI3D = 10009;
|
|
public const int ActiveContractI3D = 8;
|
|
public const int DeactivatedContractI3D = 4;
|
|
|
|
public override void Execute()
|
|
{
|
|
// In this ticket the problem was, that when you had 2 default-contracts (Rahmenvertrag)
|
|
// One of them was active, the other was deactivated
|
|
// It would choose the deactivated one by accident, and then show nothing in the UI
|
|
|
|
this.PrepareDatabase();
|
|
|
|
var offer = this.CreateNewOffer();
|
|
Assert.Equal(ActiveContractI3D, offer.ContractI3D);
|
|
}
|
|
|
|
private void PrepareDatabase()
|
|
{
|
|
this.Sql($"UPDATE dbo.VertragKopf SET Rahmenvertrag = 1, Status = 1 WHERE I3D = {ActiveContractI3D}");
|
|
this.Sql($"UPDATE dbo.VertragKopf SET Rahmenvertrag = 1, Status = 0 WHERE I3D = {DeactivatedContractI3D}");
|
|
}
|
|
|
|
private ReceiptOfferDTO CreateNewOffer()
|
|
{
|
|
var result = this.WithSession(s => s.GetBL<ReceiptWebServiceBL>().CreateNewReceipt(
|
|
CentronObjectKindNumeric.OfferClass,
|
|
this.GetLoggedInUser(),
|
|
CustomerI3D,
|
|
new CreateReceiptData
|
|
{
|
|
IgnoreCallbacks = true,
|
|
},
|
|
addressI3D: null,
|
|
contactPersonI3D: null,
|
|
insertSalutationAndAgreement: false,
|
|
ignoreDefaultContract: false,
|
|
insertCustomerDiscount: false)).ThrowIfError().Receipt;
|
|
|
|
return (ReceiptOfferDTO)result;
|
|
}
|
|
} |