using Centron.BusinessLogic; using Centron.BusinessLogic.Accounts; using Centron.Tests.EndToEnd.Infrastructure; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.TicketTests.Ticket137700; public class Ticket137700Tests : EndToEndTest { public Ticket137700Tests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { Verifier.VerifySql("AccountTypeToAccountsTests_BeforeBrokenData", "SELECT * FROM AccountTypeToAccounts ORDER BY I3D"); PrepareDatabaseWithErrors(); using var session = new BLSession(); session.GetBL().CheckAndRepairAccountTypeToAccountsTable(); Verifier.VerifySql("AccountTypeToAccountsTests_AfterDataRepair", "SELECT * FROM AccountTypeToAccounts ORDER BY I3D"); } private void PrepareDatabaseWithErrors() { base.Sql("INSERT INTO AccountTypeToAccounts (AccountI3D, AccountTypeI3D) VALUES (18,6), (1031,3)"); base.Sql("INSERT INTO AccountTypeToAccounts (AccountI3D, AccountTypeI3D, AccountCustomerI3D) VALUES (1026,1,1025), (10,1, 17)"); base.Sql("INSERT INTO AccountTypeToAccounts (AccountI3D, AccountTypeI3D, AccountSupplierI3D) VALUES (1049,2,16)"); } }