Skip to content

Instantly share code, notes, and snippets.

@toptensoftware
Created October 26, 2016 02:32
Show Gist options
  • Select an option

  • Save toptensoftware/58c5a81c1779022eb71aef91dcbed646 to your computer and use it in GitHub Desktop.

Select an option

Save toptensoftware/58c5a81c1779022eb71aef91dcbed646 to your computer and use it in GitHub Desktop.
[TestMethod]
public void AddSubtractTest()
{
// Add
Assert.AreEqual(Parser.Parse("10 + 20").Eval(), 30);
// Subtract
Assert.AreEqual(Parser.Parse("10 - 20").Eval(), -10);
// Sequence
Assert.AreEqual(Parser.Parse("10 + 20 - 40 + 100").Eval(), 90);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment