Exemplo n.º 1
0
        private void CkeckTypesAndValues(FunRuntime runtime, FuspecTestCase fus)
        {
            TypeAndValuesException outputInputException = new TypeAndValuesException();

            // Check OutputInputsErrors
            outputInputException.AddErrorMessage(CompareInOutTypeAndGetMessageErrorOrNull(fus.InputVarList, runtime.Inputs));
            outputInputException.AddErrorMessage(CompareInOutTypeAndGetMessageErrorOrNull(fus.OutputVarList, runtime.Outputs));

            //check SetCheckErrors
            var numberOfKit = 0;

            foreach (var checkOrSetKit in fus.SetChecks)
            {
                numberOfKit++;
                if (checkOrSetKit is SetData)
                {
                    outputInputException.AddErrorMessage(CompareSetCheckTypesAndGetMessageOrNull(numberOfKit, checkOrSetKit.ValuesKit, runtime.Inputs));
                }
                else
                {
                    outputInputException.AddErrorMessage(CompareSetCheckTypesAndGetMessageOrNull(numberOfKit, checkOrSetKit.ValuesKit, runtime.Outputs));
                }
            }

            // if find some output/input errors
            if (outputInputException.Messages.Any())
            {
                throw outputInputException;
            }
        }
Exemplo n.º 2
0
        private void RunOneTest(FunRuntime runtime, FuspecTestCase fus)
        {
            TypeAndValuesException outputInputException = new TypeAndValuesException();
            var numberOfKit = 0;
            var setKit      = new SetData();

            if (!runtime.Inputs.Any())
            {
                runtime.Calc();
            }

            foreach (var checkOrSetKit in fus.SetChecks)
            {
                numberOfKit++;
                if (checkOrSetKit is SetData)
                {
                    setKit = (SetData)checkOrSetKit;
                    runtime.Calc(setKit.ValuesKit.Select(v => (v.Name, v.Value)).ToArray());
                }

                /*      if (checkOrSetKit is CheckData checkKit)
                 *    {
                 *        CalculationResult results;
                 *        if (!runtime.Inputs.Any())
                 *            results = runtime.Calculate();
                 *        else
                 *            results = runtime.Calculate(setKit.ValuesKit);
                 *
                 *        foreach (var res in results.Results)
                 *        {
                 *            //c��������� ���������� �������� � �heck
                 *        }
                 *    }*/
            }

            if (outputInputException.Messages.Any())
            {
                throw outputInputException;
            }
        }