public void RoundupWithBooleanArgumentsReturnCorrectValues() { var function = new Roundup(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(2.35, true), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(2.56, false), this.ParsingContext); Assert.AreEqual(2.4d, booleanTrue.Result); Assert.AreEqual(3d, booleanFalse.Result); }
public void RoundupWithSecondInputAsNumericStringReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(25.364, "2"), this.ParsingContext); Assert.AreEqual(25.37d, result.Result); }
public void RoundupWithSecondInputAsZeroReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(12.568, 0), this.ParsingContext); Assert.AreEqual(13d, result.Result); }
public void RoundupWithSecondInputLessThanZeroReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(114512, -3), this.ParsingContext); Assert.AreEqual(115000d, result.Result); }
public void RoundupWithNoArgsReturnsPoundValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void RoundupWithNegativeIntegerAndNegativeSecondInputReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(-45, -2), this.ParsingContext); Assert.AreEqual(-100d, result.Result); }
public void RoundupWithNumberAsDateAsStringReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs("5/5/2017", 2), this.ParsingContext); Assert.AreEqual(42860d, result.Result); }
public void RoundupWithNumbericStringReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs("23.25623665", 3), this.ParsingContext); Assert.AreEqual(23.257d, result.Result); }
public void RoundupWithDoubleAndPositiveSecondInputReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(25.364, 2), this.ParsingContext); Assert.AreEqual(25.37d, result.Result); }
public void RoundupWithSecondInputAsDateAsStringReturnsCorrectValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(12.3546, "5/5/2017"), this.ParsingContext); Assert.AreEqual(12.3546d, result.Result); }
public void RoundupWithSecondInputAsGeneralStringReturnsPoundValue() { var function = new Roundup(); var result = function.Execute(FunctionsHelper.CreateArgs(45.6, "string"), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void RoundupShouldHandleNegativeNumDigits() { var func = new Roundup(); var args = FunctionsHelper.CreateArgs(99123, -2); var result = func.Execute(args, _parsingContext); Assert.AreEqual(99200d, result.Result); }
public void RoundupShouldReturnCorrectResultWithPositiveNumber() { var func = new Roundup(); var args = FunctionsHelper.CreateArgs(9.9911, 3); var result = func.Execute(args, _parsingContext); Assert.AreEqual(9.992, result.Result); }
public void RoundupShouldHandleZeroNumDigits() { var func = new Roundup(); var args = FunctionsHelper.CreateArgs(999.999, 0); var result = func.Execute(args, _parsingContext); Assert.AreEqual(1000d, result.Result); }