public void FactDoubleWithPositiveEvenDoubleReturnsCorrectResult() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs(4.9); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(8d, result.Result); }
public void FactDoubleWithTooFewArgumentsReturnsPoundValue() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs(); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)result.Result).Type); }
public void FactDoubleWithInputAsThreeReturnsCorrectResult() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs(3); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(3d, result.Result); }
public void FactDoubleWithDateInStringReturnsCorrectResult() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs("1/1/1900"); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(1d, result.Result); }
public void FactDoubleWithNegativeDoubleLessThanNegativeOneInStringReturnsPoundNum() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs("-2.5"); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)result.Result).Type); }
public void FactDoubleWithPositiveOddIntegerInStringReturnsCorrectResult() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs("5"); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(15d, result.Result); }
public void FactDoubleWithNegativeFractionReturnsCorrectResult() { var func = new FactDouble(); var args = FunctionsHelper.CreateArgs(-0.5); var result = func.Execute(args, this.ParsingContext); Assert.AreEqual(1d, result.Result); }
public void FactDoubleFunctionWithErrorValuesAsInputReturnsTheInputErrorValue() { var func = new FactDouble(); var argNA = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.NA)); var argNAME = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Name)); var argVALUE = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Value)); var argNUM = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Num)); var argDIV0 = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Div0)); var argREF = FunctionsHelper.CreateArgs(ExcelErrorValue.Create(eErrorType.Ref)); var resultNA = func.Execute(argNA, this.ParsingContext); var resultNAME = func.Execute(argNAME, this.ParsingContext); var resultVALUE = func.Execute(argVALUE, this.ParsingContext); var resultNUM = func.Execute(argNUM, this.ParsingContext); var resultDIV0 = func.Execute(argDIV0, this.ParsingContext); var resultREF = func.Execute(argREF, this.ParsingContext); Assert.AreEqual(eErrorType.NA, ((ExcelErrorValue)resultNA.Result).Type); Assert.AreEqual(eErrorType.Name, ((ExcelErrorValue)resultNAME.Result).Type); Assert.AreEqual(eErrorType.Value, ((ExcelErrorValue)resultVALUE.Result).Type); Assert.AreEqual(eErrorType.Num, ((ExcelErrorValue)resultNUM.Result).Type); Assert.AreEqual(eErrorType.Div0, ((ExcelErrorValue)resultDIV0.Result).Type); Assert.AreEqual(eErrorType.Ref, ((ExcelErrorValue)resultREF.Result).Type); }