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
100 lines
4.8 KiB
C#
100 lines
4.8 KiB
C#
using System.Collections.Generic;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.WebServices.Sales.Receipts;
|
|
using Centron.BusinessLogic.WebServices.Warehousing;
|
|
using Centron.BusinessLogic.WebServices.Warehousing.ArticleProduction;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts;
|
|
using CentronSoftware.Centron.WebServices.Entities.Warehousing;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.Production
|
|
{
|
|
public class ArticleProductionTest : EndToEndTest
|
|
{
|
|
public ArticleProductionTest(ITestOutputHelper testOutputHelper)
|
|
: base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
this.PrepareDB();
|
|
this.CreateArticleProductionMaterials();
|
|
this.GetArticleProductionMaterials();
|
|
}
|
|
|
|
private void PrepareDB()
|
|
{
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 11");
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 22");
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 33");
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 44");
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 55");
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 66");
|
|
this.Sql("UPDATE dbo.ARTIK SET Fertigungsware = 1 WHERE I3D = 77");
|
|
}
|
|
|
|
private void CreateArticleProductionMaterials()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var article1 = session.GetBL<ArticleWebServiceBL>().GetArticlePreviewByArticleI3D(3328);
|
|
var article2 = session.GetBL<ArticleWebServiceBL>().GetArticlePreviewByArticleI3D(1314);
|
|
var article3 = session.GetBL<ArticleWebServiceBL>().GetArticlePreviewByArticleI3D(4340);
|
|
var article4 = session.GetBL<ArticleWebServiceBL>().GetArticlePreviewByArticleI3D(4362);
|
|
|
|
|
|
var articleProductionMaterial1 = new ArticleProductionMaterialDTO
|
|
{
|
|
ProducedArticleI3D = 11,
|
|
MaterialArticle = article1,
|
|
Comment = "For a long time it puzzled me how something so expensive, so leading edge, could be so useless,",
|
|
Quantity = 1
|
|
|
|
};
|
|
var articleProductionMaterial2 = new ArticleProductionMaterialDTO
|
|
{
|
|
ProducedArticleI3D = 22,
|
|
MaterialArticle = article2,
|
|
Comment = "and then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things,",
|
|
Quantity = 2
|
|
|
|
};
|
|
var articleProductionMaterial3 = new ArticleProductionMaterialDTO
|
|
{
|
|
ProducedArticleI3D = 33,
|
|
MaterialArticle = article3,
|
|
Comment = "while computer programmers are smart people with the ability to do incredibly stupid things.",
|
|
Quantity = 3
|
|
|
|
};
|
|
var articleProductionMaterial14 = new ArticleProductionMaterialDTO
|
|
{
|
|
ProducedArticleI3D = 44,
|
|
MaterialArticle = article4,
|
|
Comment = "They are, in short, a perfect match. Bill Bryson",
|
|
Quantity = 4
|
|
|
|
};
|
|
var list = new List<ArticleProductionMaterialDTO>() { articleProductionMaterial1, articleProductionMaterial2 , articleProductionMaterial3, articleProductionMaterial14 };
|
|
session.GetBL<ArticleProductionWebServiceBL>().SaveOrUpdateArticleProductionMaterials(list);
|
|
}
|
|
}
|
|
|
|
private void GetArticleProductionMaterials()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var allProductionArticles = session.GetBL<ArticleProductionWebServiceBL>().GetArticleProductionMaterialsByFilter(new ArticleProductionMaterialFilter());
|
|
this.Verifier.Verify("allProductionArticles", allProductionArticles);
|
|
|
|
var billsProductionArticles = session.GetBL<ArticleProductionWebServiceBL>().GetArticleProductionMaterialsByFilter(new ArticleProductionMaterialFilter(){CommentSearchText = "Bill"});
|
|
this.Verifier.Verify("BillsProductionArticles", billsProductionArticles);
|
|
|
|
var parentProductionArticles = session.GetBL<ArticleProductionWebServiceBL>().GetArticleProductionMaterialsByFilter(new ArticleProductionMaterialFilter(){ProducedArticleI3D = 33});
|
|
this.Verifier.Verify("parentProductionArticles", parentProductionArticles);
|
|
}
|
|
}
|
|
}
|
|
} |