Deveel.Data.MathFunctionTests.RoundWithPrecision C# (CSharp) Method

RoundWithPrecision() private method

private RoundWithPrecision ( ) : void
return void
        public void RoundWithPrecision()
        {
            var value = SqlExpression.Constant(Field.Number(new SqlNumber(929928.00111992934)));
            var precision = SqlExpression.Constant(Field.Integer(10));

            var result = Select("ROUND", value, precision);

            Assert.IsNotNull(result);
            Assert.IsFalse(Field.IsNullField(result));

            Assert.IsInstanceOf<NumericType>(result.Type);
            Assert.IsInstanceOf<SqlNumber>(result.Value);

            var number = ((SqlNumber)result.Value).ToDouble();

            Assert.AreEqual(929928.0011, number);
        }