public override DataType DetermineDataTypeOfResult(MathOperationDefinition theDefinition, TestExecution testExecution)
        {
            EqualityOperationDefinition theSpecificDefinition = (EqualityOperationDefinition)theDefinition;
            foreach( DataValueDefinition valueDef in theSpecificDefinition.ValueObjects)
            {
                ValueObjects.Add(testExecution.DataValueRegistry.GetObject(valueDef.Name));
            }

            return DataType.Boolean;
        }
        public override DataType DetermineDataTypeOfResult(MathOperationDefinition theDefinition, TestExecution testExecution)
        {
            MinMaxFunctionDefinition theSpecificDefinition = (MinMaxFunctionDefinition)theDefinition;

            foreach (DataValueDefinition valueDef in theSpecificDefinition.ValueObjects)
            {
                ValueObjects.Add(testExecution.DataValueRegistry.GetObject(valueDef.Name));
            }

            return(base.DetermineDataTypeOfResult(theDefinition, testExecution));
        }
示例#3
0
        public override DataType DetermineDataTypeOfResult(MathOperationDefinition theDefinition, TestExecution testExecution)
        {
            BasicMathOperationDefinition theMoreSpecificDef = (BasicMathOperationDefinition)theDefinition;

            bool foundDecimalNumber = false;
            bool foundIntegerNumber = false;
            bool foundBooleanValue  = false;

            foreach (DataValueDefinition num in theMoreSpecificDef.ValueObjects)
            {
                DataValueInstance value = testExecution.DataValueRegistry.GetObject(num.Name);
                ValueObjects.Add(value);
                switch (value.Type)
                {
                case DataType.DecimalNumber:
                    foundDecimalNumber = true;
                    break;

                case DataType.IntegerNumber:
                    foundIntegerNumber = true;
                    break;

                case DataType.Boolean:
                    foundBooleanValue = true;
                    break;

                case DataType.NotDefined:
                    throw new ArgumentException("Type not defined for '" + value.Name + "'.");
                    break;

                default:
                    throw new ArgumentException("Type " + value.Type + " not supported by the basic math operation definition object.");
                }
            }
            if (foundDecimalNumber)
            {
                return(DataType.DecimalNumber);
                //                mDataType = DataType.DecimalNumber;
            }
            else if (foundIntegerNumber)
            {
                return(DataType.IntegerNumber);
                //                Result.SetType(DataType.IntegerNumber);
                //                mDataType = DataType.IntegerNumber;
            }
            else if (foundBooleanValue)
            {
                return(DataType.Boolean);
                //                Result.SetType(DataType.Boolean);
                //                mDataType = DataType.Boolean;
            }
            throw new ArgumentException("Data type of math operation result can't be determined.");
        }
 public MidYearSchoolReport(ValueObjects.ReportDefinitions definitions)
 {
     if (definitions == null) throw new ArgumentNullException("definitions");
     this.definitions = definitions;
 }