public void VerifyThatIsXLCVErrReturnsTrueForIntandFalsOtherwise()
        {
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrDiv0));
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrNA));
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrName));
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrNull));
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrNum));
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrRef));
            Assert.IsTrue(ExcelErrors.IsXLCVErr((int)XlCVError.xlErrValue));

            var str = string.Empty;

            Assert.IsFalse(ExcelErrors.IsXLCVErr(str));

            double d = 10f;

            Assert.IsFalse(ExcelErrors.IsXLCVErr(d));

            float f = 10f;

            Assert.IsFalse(ExcelErrors.IsXLCVErr(f));

            DateTime date = DateTime.Parse("2012-12-12");

            Assert.IsFalse(ExcelErrors.IsXLCVErr(date));

            DateTime dateTime = DateTime.Parse("2012-12-12T23:11:11.001");

            Assert.IsFalse(ExcelErrors.IsXLCVErr(dateTime));
        }
Пример #2
0
        /// <summary>
        /// Queries the formula-value at the row in the <see cref="parameterFormula"/> array
        /// </summary>
        /// <param name="i">
        /// The row in the <see cref="parameterFormula"/> array
        /// </param>
        /// <returns>
        /// a string representing the formula value
        /// </returns>
        private string QueryFormulaValue(int i)
        {
            string formulaValue = "-";

            var formulaObject = this.parameterFormula[i, ParameterSheetConstants.ComputedColumn];

            if (formulaObject != null && !ExcelErrors.IsXLCVErr(formulaObject))
            {
                formulaValue = Convert.ToString(formulaObject);
            }

            return(formulaValue);
        }
Пример #3
0
        /// <summary>
        /// Queries the actual-value at the row in the <see cref="parameterContent"/> array
        /// </summary>
        /// <param name="i">
        /// The row in the <see cref="parameterContent"/> array
        /// </param>
        /// <returns>
        /// an object that represents the actual value
        /// </returns>
        private object QueryActualValue(int i)
        {
            object actualValue;

            var actualObject = this.parameterContent[i, ParameterSheetConstants.ActualValueColumn];

            if (actualObject != null && !ExcelErrors.IsXLCVErr(actualObject))
            {
                actualValue = actualObject;
            }
            else
            {
                actualValue = "-";
            }

            return(actualValue);
        }
Пример #4
0
        /// <summary>
        /// Queries the reference-value at the row in the <see cref="parameterContent"/> array
        /// </summary>
        /// <param name="i">
        /// The row in the <see cref="parameterContent"/> array
        /// </param>
        /// <returns>
        /// an object that represents the reference value
        /// </returns>
        private object QueryReferenceValue(int i)
        {
            object referenceValue;

            var referenceObject = this.parameterContent[i, ParameterSheetConstants.ReferenceColumn];

            if (referenceObject != null && !ExcelErrors.IsXLCVErr(referenceObject))
            {
                referenceValue = referenceObject;
            }
            else
            {
                referenceValue = "-";
            }

            return(referenceValue);
        }
Пример #5
0
        /// <summary>
        /// Queries the manual-value at the row in the <see cref="parameterContent"/> array
        /// </summary>
        /// <param name="i">
        /// The row in the <see cref="parameterContent"/> array
        /// </param>
        /// <returns>
        /// an object that represents the manual value
        /// </returns>
        private object QueryManualValue(int i)
        {
            object manualValue;

            var manualObject = this.parameterContent[i, ParameterSheetConstants.ManualColumn];

            if (manualObject != null && !ExcelErrors.IsXLCVErr(manualObject))
            {
                manualValue = manualObject;
            }
            else
            {
                manualValue = "-";
            }

            return(manualValue);
        }
Пример #6
0
        /// <summary>
        /// Queries the computed-value at the row in the <see cref="parameterContent"/> array
        /// </summary>
        /// <param name="i">
        /// The row in the <see cref="parameterContent"/> array
        /// </param>
        /// <returns>
        /// an object that represents the computed value
        /// </returns>
        private object QueryComputedValue(int i)
        {
            object computedValue;

            var computedObject = this.parameterContent[i, ParameterSheetConstants.ComputedColumn];

            if (computedObject != null && !ExcelErrors.IsXLCVErr(computedObject))
            {
                computedValue = computedObject;
            }
            else
            {
                computedValue = "-";
            }

            return(computedValue);
        }