public static bool Check(this IFormTarget reference, IFormTarget test, out string error)
        {
            var spec  = CompareValues(reference.SpecificationValues, test.SpecificationValues);
            var value = CompareValues(reference.ResultValues, test.ResultValues);

            var result = spec.Concat(value).ToList();

            if (result.Count == 0)
            {
                error = "";
                return(true);
            }
            error = string.Join("\r\n", result);
            return(false);
        }
        public async Task LoadResultAsync(IFormTarget target = null)
        {
            await FormHelper.LoadAsync(target ?? Model).ConfigureAwait(true);

            var state = Workflow.CurrentStage;

            if (state == SampleTestWorkflow.Specifications)
            {
                FormHelper.Form.Mode = FormMode.Specification;
            }
            //else if (state == SampleTestWorkflow.Running)
            //    FormHelper.Mode = TestFormMode.Capture;
            else
            {
                FormHelper.Form.Mode = FormMode.ReadOnly;
            }
        }
        public static void Load(this IFormTarget target, IFormTarget source)
        {
            target.FormClass = source.FormClass;
            target.Name      = source.Name;

            target.SpecificationValues = source.SpecificationValues;
            target.ResultValues        = source.ResultValues;

            target.SpecificationDone = source.SpecificationDone;
            target.MandatoryDone     = source.MandatoryDone;

            target.TestName      = source.TestName;
            target.Description   = source.Description;
            target.Specification = source.Specification;
            target.Result        = source.Result;
            target.Conformity    = source.Conformity;
            target.ConformityId  = source.ConformityId;
        }
 public static T Clone <T>(this IFormTarget source) where T : IFormTarget, new()
 {
     return(new T
     {
         FormClass = source.FormClass,
         Name = source.Name,
         SpecificationValues = source.SpecificationValues,
         ResultValues = source.ResultValues,
         SpecificationDone = source.SpecificationDone,
         MandatoryDone = source.MandatoryDone,
         TestName = source.TestName,
         Description = source.Description,
         Specification = source.Specification,
         Result = source.Result,
         Conformity = source.Conformity,
         ConformityId = source.ConformityId
     });
 }