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
103 lines
4.5 KiB
C#
103 lines
4.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Services;
|
|
using Centron.BusinessLogic.WebServices.Statistics.SaleStatistics;
|
|
using Centron.Interfaces.BL;
|
|
using Centron.Interfaces.Statistics.SaleStatistics;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.Entities.Services;
|
|
using CentronSoftware.Centron.WebServices.Entities.Statistics.SaleStatistics;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.Statistics.SaleStatistics
|
|
{
|
|
public class SaleStatisticTests : EndToEndTest
|
|
{
|
|
public SaleStatisticTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
|
|
{
|
|
Verifier.Settings.IgnoreProperty<SaleStatisticDTO>(f => f.I3D);
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
PrepareBugFromTicket123335();
|
|
|
|
using var session = new BLSession();
|
|
session.GetBL<CachedTableBL>().RequestImmediateCacheUpdate(CacheAvailableTables.SalesStatistic);
|
|
|
|
var result = session.GetBL<SaleStatisticWebServiceBL>().GetSalesArticleStatistic(base.GetLoggedInUser(),
|
|
new SalesArticleStatisticFilter()
|
|
{
|
|
DateFrom = new DateTime(2017,1,1),
|
|
DateTo = new DateTime(2017,12,31)
|
|
});
|
|
Assert.True(result.Status == ResultStatus.Success, result.Message);
|
|
Verifier.Verify("SaleStatistic2017", result.Data.OrderBy(o => o.Date)
|
|
.ThenBy(o => o.ReceiptNumber)
|
|
.ThenBy(o => o.ArticleI3D)
|
|
.ThenBy(o => o.ContractCaption));
|
|
|
|
result = session.GetBL<SaleStatisticWebServiceBL>().GetSalesArticleStatistic(base.GetLoggedInUser(),
|
|
new SalesArticleStatisticFilter()
|
|
{
|
|
MaterialGroups = new List<StatisticMaterialGroupFilter>()
|
|
{
|
|
new()
|
|
{
|
|
MaterialGroupI3D = 1
|
|
},
|
|
new()
|
|
{
|
|
MaterialGroupI3D = 7,
|
|
SubMaterialGroupI3D = 11
|
|
},
|
|
new()
|
|
{
|
|
MaterialGroupI3D = 0,
|
|
SubMaterialGroupI3D = 2
|
|
}
|
|
}
|
|
});
|
|
Assert.True(result.Status == ResultStatus.Success, result.Message);
|
|
Verifier.Verify("SaleStatisticMaterialGroupFilterHardware", result.Data.OrderBy(o => o.Date)
|
|
.ThenBy(o => o.ReceiptNumber)
|
|
.ThenBy(o => o.ArticleI3D)
|
|
.ThenBy(o => o.ContractCaption));
|
|
|
|
result = session.GetBL<SaleStatisticWebServiceBL>().GetSalesArticleStatistic(base.GetLoggedInUser(),
|
|
new SalesArticleStatisticFilter()
|
|
{
|
|
ArticleI3Ds = new List<int>() { 57 }
|
|
});
|
|
Assert.True(result.Status == ResultStatus.Success, result.Message);
|
|
Verifier.Verify("SaleStatisticArticleFilterService", result.Data.OrderBy(o => o.Date)
|
|
.ThenBy(o => o.ReceiptNumber)
|
|
.ThenBy(o => o.ArticleI3D)
|
|
.ThenBy(o => o.ContractCaption));
|
|
|
|
result = session.GetBL<SaleStatisticWebServiceBL>().GetSalesArticleStatistic(base.GetLoggedInUser(),
|
|
new SalesArticleStatisticFilter()
|
|
{
|
|
CustomerI3Ds = new List<int>() { 10012, 10010 }
|
|
});
|
|
Assert.True(result.Status == ResultStatus.Success, result.Message);
|
|
Verifier.Verify("SaleStatisticCustomerFilter", result.Data.OrderBy(o => o.Date)
|
|
.ThenBy(o => o.ReceiptNumber)
|
|
.ThenBy(o => o.ArticleI3D)
|
|
.ThenBy(o => o.ContractCaption));
|
|
}
|
|
|
|
private void PrepareBugFromTicket123335()
|
|
{
|
|
// Insert for the invoice 40227 a second contract entry into "VertragRechKopfZuordnung". Before the fix,
|
|
// this would result in a multiplication from the value, because the join would return 2 entries
|
|
Sql(@"INSERT INTO VertragRechKopfZuordnung
|
|
(VertragI3D, RechKopfI3D, BerechnungszeitraumVon, BerechnungszeitraumBis, Status, Zwischenrechnung, KontingentArt)
|
|
VALUES
|
|
(32, 1337, '20170301', '20170430', 1, 0, 1)");
|
|
}
|
|
}
|
|
} |