public void ComputeFormula_SimpleExponentFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("8^(2)"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("64", lResult); }
public void ComputeFormula_MultiplicationFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("7×5"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("35", lResult); }
public void ComputeFormula_NegativeFloatDivisionFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("8.56÷(-37.2110)"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("(-0,23003950444761)", lResult.ToString()); }
public void ComputeFormula_DivisionByZeroFormula_ReturnsException() { PEMDAS lPemdas = new PEMDAS("8÷0"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("∞", lResult); }
public void ComputeFormula_SimpleRootSquareFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("√(64)"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("8", lResult); }
public void ComputeFormula_SimpleFloatSubstraction_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("7.51-5.6333333"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("1,8766667", lResult); }
public void ComputeFormula_SubtractNegative_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("7.51-(-5.6333333)"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("13,1433333", lResult); }
public void ComputeFormula_SimpleAdditionFormula2_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("5+0.7"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("5,7", lResult); }
public void ComputeFormula_SimpleFloatAdditionFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("5.591112+7.158165555"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("12,749277555", lResult); }
public void ComputeFormula_SimpleAdditionFormulaWithComa_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("5.5+7.15"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("12,65", lResult); }
public void ComputeFormula_SimpleSubstractionFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("7-5"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("2", lResult); }
public void ComputeFormula_SimpleDivisionFormula_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("8÷2"); var lResult = lPemdas.ComputeFormula(); Assert.AreEqual("4", lResult); }
public void DoCompute_WithRootSquare3_ReturnsException() { PEMDAS lPemdas = new PEMDAS("√((-1))"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("NaN", lResult); }
public void DoCompute_WithRootSquare2_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("√(15)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("3,87298334620742", lResult); }
public void DoCompute_WithRootSquare_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("√(81)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("9", lResult); }
public void DoCompute_ExponentWithNegativeNumberAfterOperator_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("5^((-2))"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("0,04", lResult.ToString()); }
public void DoCompute_ExponentWithNegativeNumberBeforeOperator_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("(-5)^(2)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("25", lResult.ToString()); }
public void DoCompute_WithMultiplication2_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("15.67×16.20"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("253,854", lResult.ToString()); }
public void DoCompute_MultiplicationWithNegativeNumberAfterOperator_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("(-15)×(-16)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("240", lResult.ToString()); }
public void DoCompute_WithDivision4_ReturnsException() { PEMDAS lPemdas = new PEMDAS("1÷0.99999999999999999999999999999999999999999999999999999999999999999999999999999"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("1", lResult); }
public void DoCompute_DivisionByZero_ReturnsInfinityNumber() { PEMDAS lPemdas = new PEMDAS("15.67÷0"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("∞", lResult.ToString()); }
public void DoCompute_WithDivision2_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("15.67÷16.20"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("0,967283950617284", lResult.ToString()); }
public void DoCompute_WithDivision_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("15÷16"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("0,9375", lResult.ToString()); }
public void DoReplaceByResult_SimplyOperation_ReturnsNewFormulaWithResult() { PEMDAS lPemdas = new PEMDAS("5×7"); lPemdas.DoReplaceByResult("35"); Assert.AreEqual("35", lPemdas.Chunk.SB.ToString()); }
public void DoCompute_WithExponent_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("15^(2)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("225", lResult.ToString()); }
public void DoCompute_WithMultiplication3_ReturnsException() { PEMDAS lPemdas = new PEMDAS("156700000000000000000000000000000000000000000000000000000000000000×1600000000000000000000000000000000000000000000000000000000000000020"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("2,5072E+131", lResult); }
public void DoCompute_WithExponent2_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("15^(16)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("6,56840835571289E+18", lResult.ToString()); }
public void DoCompute_ExponentWithHugeNumber_ReturnsInfinityNumber() { PEMDAS lPemdas = new PEMDAS("150^(1000)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("∞", lResult.ToString()); }
public void DoCompute_DivisionWithNegativeNumberAfterOperator_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("15÷(-16)"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("(-0,9375)", lResult); }
public void DoCompute_SubstactionWithNegativeNumberBeforeOperator_ReturnsResult() { PEMDAS lPemdas = new PEMDAS("(-15)-16"); lPemdas.DoCompute(out string lResult); Assert.AreEqual("(-31)", lResult.ToString()); }