using Centron.BusinessLogic.WebServices.Administration.Settings.SettingGroups; using Centron.BusinessLogic.WebServices.Sales.Support; using Centron.Gateway.OpenTrans; using Centron.Host.RestRequests; using Centron.Office.Client.Analytics.Events; using Centron.Tests.EndToEnd.Infrastructure; using Xunit; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.TicketTests.Ticket142989; public class Ticket142989Tests : EndToEndTest { public Ticket142989Tests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public const int CustomerI3D = 10017; // This customer has employee 27 as their advisor-1 public const int EmployeeI3D = 27; // We will make this employees short-sign very long public const string LongShortSign = "abcdefghijklmnopqrstuvwxyz"; // 26 characters public override void Execute() { // In this ticket, an error occurred when an employee, who also serves as a customer advisor, has a short-sign exceeding 15 characters. // If you attempt to create and save a ticket for this customer, an error message appeared, // stating "string or binary data truncated" due to the length of the employee's short-sign. // // It seems like some columns were forgotten in PR 13454, Ticket 132910, ScriptMethod11376 this.PrepareDatabase(); var request = new SaveNewSimpleTicketRequest { CustomerI3D = CustomerI3D, ShortDescription = "My printer is burning!", }; var ticket = this.WithSession(s => s.GetBL().SaveNewSimpleTicket(request, this.GetLoggedInUser())); Assert.NotNull(ticket); } private void PrepareDatabase() { this.Sql($"UPDATE Personal SET KurzZeich = '{LongShortSign}' WHERE I3D = {EmployeeI3D}"); this.WithSession(s => s.GetBL().UpdateIgnoreRequiredFieldsSetting(true)); } }