public void ArythemeticStetementPriorityTest() { string basicInput = "2 + 2 * 2"; ArythmeticStatement testStatement = new ArythmeticStatement(basicInput, new InstructionsBlock()); variable result = testStatement.Execute(); Assert.AreEqual(typeof(int), result.type); Assert.AreEqual(6, (int)(result.value)); }
public void ArythemeticStetementDoubleTypeTest() { string basicInput = "2.0 + 2.0 * 2.0"; ArythmeticStatement testStatement = new ArythmeticStatement(basicInput, new InstructionsBlock()); variable result = testStatement.Execute(); Assert.AreEqual(typeof(double), result.type); Assert.AreEqual(6.0, (double)(result.value)); }