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
95 lines
3.6 KiB
C#
95 lines
3.6 KiB
C#
using System;
|
|
using System.Linq;
|
|
using Centron.BusinessLogic;
|
|
using Centron.BusinessLogic.Notifications;
|
|
using Centron.BusinessLogic.WebServices.Notifications;
|
|
using Centron.Tests.EndToEnd.Infrastructure;
|
|
using CentronSoftware.Centron.WebServices.Entities.Notifications;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace Centron.Tests.EndToEnd.Tests.CentronNotification
|
|
{
|
|
public class CentronNotificationTest : EndToEndTest
|
|
{
|
|
public CentronNotificationTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper)
|
|
{
|
|
}
|
|
|
|
public override void Execute()
|
|
{
|
|
this.CreateNotifications();
|
|
this.DeleteCentronNotification();
|
|
this.LoadCentronNotifications();
|
|
}
|
|
|
|
private void CreateNotifications()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var notificationError = new Data.Entities.Notifications.CentronNotification
|
|
{
|
|
LogKind = LogKind.Error,
|
|
Text = "Developer: We have a problem",
|
|
CreatedDate = DateTime.Now,
|
|
ShortSign = "Dienst",
|
|
ObjectKind = 123,
|
|
ObjectI3D = null
|
|
};
|
|
|
|
var notificationSucces = new Data.Entities.Notifications.CentronNotification()
|
|
{
|
|
LogKind = LogKind.Successful,
|
|
Text = "Manager: There are no such things as problems, only opportunities",
|
|
CreatedDate = DateTime.Now,
|
|
ShortSign = "Dienst",
|
|
ObjectKind = 321,
|
|
ObjectI3D = 42
|
|
};
|
|
|
|
var notifificationPartlyError = new Data.Entities.Notifications.CentronNotification()
|
|
{
|
|
LogKind = LogKind.PartlyError,
|
|
Text = "Developer: Well then, we have a DDoS opportunity",
|
|
CreatedDate = DateTime.Now,
|
|
ShortSign = "Dienst"
|
|
};
|
|
|
|
var notificationForDelete = new Data.Entities.Notifications.CentronNotification()
|
|
{
|
|
LogKind = LogKind.Successful,
|
|
Text = "If you find me in the final text file, something went wrong",
|
|
CreatedDate = DateTime.Now.AddDays(-15),
|
|
ShortSign = "Waldo"
|
|
};
|
|
|
|
session.GetBL<CentronNotificationsBL>().SaveCentronNotification(notificationError);
|
|
session.GetBL<CentronNotificationsBL>().SaveCentronNotification(notificationSucces);
|
|
session.GetBL<CentronNotificationsBL>().SaveCentronNotification(notifificationPartlyError);
|
|
session.GetBL<CentronNotificationsBL>().SaveCentronNotification(notificationForDelete);
|
|
}
|
|
}
|
|
|
|
private void DeleteCentronNotification()
|
|
{
|
|
var filter = new CentronNotificationsFilter()
|
|
{
|
|
DateUntil = DateTime.Now.AddDays(-14)
|
|
};
|
|
|
|
using (var session = new BLSession())
|
|
{
|
|
session.GetBL<CentronNotificationsWebServiceBL>().DeleteCentronNotifications(filter);
|
|
}
|
|
}
|
|
|
|
private void LoadCentronNotifications()
|
|
{
|
|
using (var session = new BLSession())
|
|
{
|
|
var centronNotifiactions = session.GetBL<CentronNotificationsWebServiceBL>().GetCentronNotificationsByFilter(new CentronNotificationsFilter());
|
|
|
|
this.Verifier.Verify("CentronNotification", centronNotifiactions.Data);
|
|
}
|
|
}
|
|
}
|
|
} |