using System.Collections.Generic; using Centron.BusinessLogic; using Centron.BusinessLogic.WebServices.Sales.Receipts; using Centron.Interfaces.Sales.Receipts; using Centron.Tests.EndToEnd.Infrastructure; using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.Tests.ReceiptProvisionGoals; public class ReceiptProvisionGoalTests : EndToEndTest { public ReceiptProvisionGoalTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } private const int EmployeeI3D = 10; public override void Execute() { this.SaveGoals(step: 1); this.LoadGoals(step: 2); } private void SaveGoals(int step) { using var session = new BLSession(); var goals = new List { new() { Month = 1, Goal = 500, }, new() { Month = 2, Goal = 500, }, new() { Month = 3, Goal = 500, }, new() { Month = 4, Goal = 500, }, new() { Month = 5, Goal = 500, }, new() { Month = 6, Goal = 1000, }, }; session.GetBL().SaveEmployeeGoals(EmployeeI3D, 2022, goals); this.Verifier.VerifyTable($"{step}_Goals_Table", "ReceiptProvisionEmployeeGoals"); } private void LoadGoals(int step) { using var session = new BLSession(); var goals = session.GetBL().GetGoals(new() { EmployeeI3Ds = new List { EmployeeI3D } }); this.Verifier.Verify($"{step}_Goals", goals); } }