public void CeilingMathWithZeroModeReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-10.3, 2, 0), this.ParsingContext); Assert.AreEqual(-10d, result.Result); }
public void CeilingMathShouldReturnCorrectResult() { var func = new CeilingMath(); var args = FunctionsHelper.CreateArgs(15.25); var result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(16d, result); args = FunctionsHelper.CreateArgs(15.25, 0.1); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(15.3d, result); args = FunctionsHelper.CreateArgs(15.25, 5); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(20d, result); args = FunctionsHelper.CreateArgs(-15.25, 1); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(-15d, result); args = FunctionsHelper.CreateArgs(-15.25, 1, 1); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(-16d, result); args = FunctionsHelper.CreateArgs(-15.25, 10); result = func.Execute(args, _parsingContext).Result; Assert.AreEqual(-10d, result); }
public void CeilingMathWithNoInputsReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void CeilingMathWithNegativeModeInputReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-10.4, 2, -10), this.ParsingContext); Assert.AreEqual(-12d, result.Result); }
public void CeilingMathWithStringModeInputReturnsPoundValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-10.4, 2, "string"), this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void CeilingMathWithDoubleSignificanceReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(10.4, 5.6), this.ParsingContext); Assert.AreEqual(11.2d, result.Result); }
public void CeilingMathWithZeroSignificanceReturnsZero() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(10.4, 0), this.ParsingContext); Assert.AreEqual(0d, result.Result); }
public void CeilingMathWithDoubleNumberInputReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(10.5, 5), this.ParsingContext); Assert.AreEqual(15d, result.Result); }
public void CeilingMathWithLastTwoInputsPositiveReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(-10.5, 2, 2), this.ParsingContext); Assert.AreEqual(-12d, result.Result); }
public void CeilingMathWithMiddleNegativeInputReturnsCorrectValue() { var function = new CeilingMath(); var result = function.Execute(FunctionsHelper.CreateArgs(10.5, -2, 2), this.ParsingContext); Assert.AreEqual(12d, result.Result); }
public void CeilingMathWithBooleanModeInputReturnsCorrectValue() { var function = new CeilingMath(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(-10.4, 2, true), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(-10.4, 2, false), this.ParsingContext); Assert.AreEqual(-12d, booleanTrue.Result); Assert.AreEqual(-10d, booleanFalse.Result); }
public void CeilingMathWithBooleanSignificanceReturnsCorrectValue() { var function = new CeilingMath(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(10.5, true), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(10.4, false), this.ParsingContext); Assert.AreEqual(11d, booleanTrue.Result); Assert.AreEqual(0d, booleanFalse.Result); }
public void CeilingMathWithBooleanNumberInputReturnsCorrectValue() { var function = new CeilingMath(); var booleanTrue = function.Execute(FunctionsHelper.CreateArgs(true, 10), this.ParsingContext); var booleanFalse = function.Execute(FunctionsHelper.CreateArgs(false, 3), this.ParsingContext); Assert.AreEqual(10d, booleanTrue.Result); Assert.AreEqual(0d, booleanFalse.Result); }