예제 #1
0
        public void GetValue_ValueStepStyle_EquivalentToMathCeiling(decimal value)
        {
            var rounder = new NumericRounding(1, Rounding.RoundingStyle.Ceiling);

            Assert.That(rounder.GetValue(value), Is.EqualTo(Math.Ceiling(value)));
        }
예제 #2
0
        public void GetValue_ValueStepStyle_NewValue(decimal value, double step, Rounding.RoundingStyle roundingStyle, decimal newValue)
        {
            var rounder = new NumericRounding(step, roundingStyle);

            Assert.That(rounder.GetValue(value), Is.EqualTo(newValue));
        }
예제 #3
0
        public void GetValue_ValueStepStyle_EquivalentToMathRound(decimal value)
        {
            var rounder = new NumericRounding(0.1m, Rounding.RoundingStyle.Round);

            Assert.That(rounder.GetValue(value), Is.EqualTo(Math.Round(value, 1)));
        }