/* * Created by Ranorex * User: rodriqu_dd * Date: 06/12/2020 * Time: 18:44 * * To change this template use Tools > Options > Coding > Edit standard headers. */ using System; using System.Collections.Generic; using System.Text; using System.Text.RegularExpressions; using System.Drawing; using System.Threading; using WinForms = System.Windows.Forms; using Newtonsoft.Json; using Ranorex; using Ranorex.Core; using Ranorex.Core.Testing; namespace AutomatedSystemTests.Modules.ActionsDocumentView { /// /// Description of ValidateSectionsCombinationsView. /// [TestModule("4AEF939A-35A6-4173-A921-C521453B760A", ModuleType.UserCode, 1)] public class ValidateSectionsCombinationsView : ITestModule { string _trajectAssessmentInformationString = ""; [TestVariable("5dda9c28-3af1-49bc-b8d6-81c994d32f4d")] public string trajectAssessmentInformationString { get { return _trajectAssessmentInformationString; } set { _trajectAssessmentInformationString = value; } } /// /// Constructs a new instance. /// public ValidateSectionsCombinationsView() { // Do not delete - a parameterless constructor is required! } /// /// Performs the playback of actions in this module. /// /// You should not call this method directly, instead pass the module /// instance to the method /// that will in turn invoke this method. void ITestModule.Run() { Mouse.DefaultMoveTime = 0; Keyboard.DefaultKeyPressTime = 0; Delay.SpeedFactor = 0.0; var trajectAssessmentInformation = BuildAssessmenTrajectInformation(trajectAssessmentInformationString); var repo = global::AutomatedSystemTests.AutomatedSystemTestsRepository.Instance; } private TrajectAssessmentInformation BuildAssessmenTrajectInformation(string trajectAssessmentInformationString) { TrajectAssessmentInformation trajectAssessmentInformation; if (trajectAssessmentInformationString=="") { trajectAssessmentInformation = new TrajectAssessmentInformation(); } else { var error = false; trajectAssessmentInformation = JsonConvert.DeserializeObject(trajectAssessmentInformationString, new JsonSerializerSettings { Error = (s, e) => { error = true; e.ErrorContext.Handled = true; } } ); if (error==true) { Report.Log(ReportLevel.Error, "error unserializing json string for trajectAssessmentInformationString: " + trajectAssessmentInformationString); } } return trajectAssessmentInformation; } } }