public void FloorMathWithZeroSignificanceReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(56.7, 0), this.ParsingContext); Assert.AreEqual(0d, result.Result); }
public void FloorMathWithDateAsStringNumberReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs("5/5/2017", 4), this.ParsingContext); Assert.AreEqual(42860d, result.Result); }
public void FloorMathWithZeroModeReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-5.5, 2, 0), this.ParsingContext); Assert.AreEqual(-6d, result.Result); }
public void FloorMathWithPositiveNumberNegativeSigReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(15.7, -2), this.ParsingContext); Assert.AreEqual(14d, result.Result); }
public void FloorMathShouldReturnCorrectResult() { var func = new FloorMath(); var args = FunctionsHelper.CreateArgs(58.55); var result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(58d, result); args = FunctionsHelper.CreateArgs(58.55, 0.1); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(58.5d, result); args = FunctionsHelper.CreateArgs(58.55, 5); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(55d, result); args = FunctionsHelper.CreateArgs(-58.55, 1); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(-59d, result); args = FunctionsHelper.CreateArgs(-58.55, 1, 1); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(-58d, result); args = FunctionsHelper.CreateArgs(-58.55, 10); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(-60d, result); }
public void FloorMathWithNoInputsReturnsPoundValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void FloorMathWithAllThreeInputsReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(14.56, 4, 6), this.ParsingContext); Assert.AreEqual(12d, result.Result); }
public void FloorMathWithGeneralStringModeInputReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(34.5, 3, "string"), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void FloorMathWithNumericStringModeInputReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-45.7, 4, "2"), this.ParsingContext); Assert.AreEqual(-44d, result.Result); }
public void FloorMathWithDateAsStringModeInputReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-45.6, 3, "5/5/2017"), this.ParsingContext); Assert.AreEqual(-45d, result.Result); }
public void FloorMathWithNumericStringSignificanceReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(4.67, "2"), this.ParsingContext); Assert.AreEqual(4d, result.Result); }
public void FloorMathWithDecimalSignificanceReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(45.67, 2.34), this.ParsingContext); Assert.AreEqual(44.46d, (double)result.Result, 0.000001); }
public void FloorMathWithDateAsStringSignificanceReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs(45548564.6, "5/5/2017"), this.ParsingContext); Assert.AreEqual(45517320d, result.Result); }
public void FloorMathWithNumericStringNumberReturnsCorrectValue() { var function = new FloorMath(); var result = function.Execute(FunctionsHelper.CreateArgs("5.67", 3), this.ParsingContext); Assert.AreEqual(3d, result.Result); }
public void FloorMathWithBooleanSignificanceReturnsCorrectValue() { var function = new FloorMath(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(45.6, true), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(45.6, false), this.ParsingContext); Assert.AreEqual(45d, booleanTrue.Result); Assert.AreEqual(0d, booleanFalse.Result); }
public void FloorMathWithBooleanModeInputReturnsCorrectValue() { var function = new FloorMath(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(-45.7, 3, true), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(-45.7, 3, false), this.ParsingContext); Assert.AreEqual(-45d, booleanTrue.Result); Assert.AreEqual(-48d, booleanFalse.Result); }
public void FloorMathWithBooleanNumberInputReturnsZero() { var function = new FloorMath(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(true, 5), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(false, 3), this.ParsingContext); Assert.AreEqual(0d, booleanTrue.Result); Assert.AreEqual(0d, booleanFalse.Result); }