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))); }
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)); }
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))); }