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
60 lines
2.4 KiB
C#
60 lines
2.4 KiB
C#
using System.IO;
|
|
using System.Text;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.EmployeeArea;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.Data.Entities.Administration;
|
|
using Centron.Data.WebServices.Sales.Receipts.Offers;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.ITscopeOffer
|
|
{
|
|
public class ITscopeOfferTests : EndToEndTest
|
|
{
|
|
public ITscopeOfferTests(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
this.Verifier.Settings.IgnoreProperty<ReceiptOfferItemDTO>(f => f.PurchaseBasePrice);
|
|
this.Verifier.Settings.IgnoreProperty<ReceiptOfferItemDTO>(f => f.OriginalPurchasePrice);
|
|
|
|
// Have to ignore ManufacturerCode as well, because the articles don't exist at ITscope anymore,
|
|
// so we fall back to ARTIKNEU, and have a GUID in the ManufacturerCode
|
|
this.Verifier.Settings.IgnoreProperty<ReceiptOfferItemDTO>(f => f.ManufacturerCode);
|
|
}
|
|
|
|
[Fact(Skip = "Depends on ITscope API which sometimes changes it's data and then this test is flaky.")]
|
|
public override void Execute()
|
|
{
|
|
// Make sure the company-name is included in the invoice-address and delivery-address
|
|
this.CreateOffer("OpenTransOffer1");
|
|
|
|
// Make sure the special characters work correctly
|
|
this.CreateOffer("OpenTransOffer2");
|
|
}
|
|
|
|
private void CreateOffer(string name)
|
|
{
|
|
var openTransDocument = this.GetOpenTransDocument(name + ".xml");
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
int customerI3D = 10000;
|
|
var user = session.GetBL<AppUserBL>().GetAppUser(f => f.I3D == 11);
|
|
|
|
var offer = session.GetBL<ReceiptWebServiceBL>().CreateOfferFromITscope(customerI3D, null, null, null, openTransDocument, user);
|
|
this.Verifier.Verify(name, offer);
|
|
}
|
|
}
|
|
|
|
private string GetOpenTransDocument(string name)
|
|
{
|
|
using (var stream = this.GetType().Assembly.GetManifestResourceStream(this.GetType(), name))
|
|
using (var reader = new StreamReader(stream, Encoding.UTF8))
|
|
{
|
|
return reader.ReadToEnd();
|
|
}
|
|
}
|
|
}
|
|
} |