public void RoundDownWithBooleanSecondInputReturnsCorrectValue() { var function = new Rounddown(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(12.345, true), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(12.345, false), this.ParsingContext); Assert.AreEqual(12.3d, booleanTrue.Result); Assert.AreEqual(12d, booleanFalse.Result); }
public void RoundDownWithNegativeSecondInputReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(9333.23, -3), this.ParsingContext); Assert.AreEqual(9000d, result.Result); }
public void RoundDownWithPositiveSecondInputReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(12.356, 1), this.ParsingContext); Assert.AreEqual(12.3d, result.Result); }
public void RoundDownWithNoInputsReturnsPoundValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void RoundDownWithSecondArgumentAsDateAsStringReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(52.3, "5/5/2017"), this.ParsingContext); Assert.AreEqual(52.3d, result.Result); }
public void RoundDownWithNegativeDoublePositiveSecondArgReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(-5.326571, 3), this.ParsingContext); Assert.AreEqual(-5.326d, result.Result); }
public void RoundDownWithNegativeIntegerNegativeSecondArgReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(-98, -2), this.ParsingContext); Assert.AreEqual(0d, result.Result); }
public void RoundDownWithFirstInputAsDateAsStringReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs("5/5/2017", 2), this.ParsingContext); Assert.AreEqual(42860d, result.Result); }
public void RoundDownWithGeneralStringFirstInputReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs("string", 3), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void RoundDownWithNumericStringFirstInputReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs("45546.546444", 3), this.ParsingContext); Assert.AreEqual(45546.546d, result.Result); }
public void RoundDownWithZeroSecondInputReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(58.999999, 0), this.ParsingContext); Assert.AreEqual(58d, result.Result); }
public void RoundDownWithNumericStringSecondArgumentReturnsCorrectValue() { var function = new Rounddown(); var result = function.Execute(FunctionsHelper.CreateArgs(15.351, "2"), this.ParsingContext); Assert.AreEqual(15.35, result.Result); }
public void RounddownShouldHandleZeroNumDigits() { var func = new Rounddown(); var args = FunctionsHelper.CreateArgs(999.999, 0); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(999d, result.Result); }
public void RounddownShouldReturn0IfNegativeNumDigitsIsTooLarge() { var func = new Rounddown(); var args = FunctionsHelper.CreateArgs(999.999, -4); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(0d, result.Result); }
public void RounddownShouldHandleNegativeNumber() { var func = new Rounddown(); var args = FunctionsHelper.CreateArgs(-9.999, 2); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(-9.99, result.Result); }
public void RounddownShouldReturnCorrectResultWithPositiveNumber() { var func = new Rounddown(); var args = FunctionsHelper.CreateArgs(9.999, 2); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(9.99, result.Result); }
public void RounddownShouldHandleNegativeNumDigits() { var func = new Rounddown(); var args = FunctionsHelper.CreateArgs(999.999, -2); var result = func.Execute(args, _parsingContext); Assert.AreEqual(900d, result.Result); }