public CalculatorViewModel(IEquationParser equationParser, Calculator calculator) { _equationParser = equationParser; _calculator = calculator; ExecuteCommand = new DelegateCommand(Execute); }
public void WhenExecutingAndAddEquation_ThenResultShouldEqualThree() { // Arrange var calculator = new Calculator(); var equation = new Equation() { Tokens = new List<Token>() { new Token() {Value = 1m, Type = TokenType.Value}, new Token() {Value = "+", Type = TokenType.Operator}, new Token() {Value = 2m, Type = TokenType.Value}, } }; // Act var result = calculator.Solve(equation); // Assert Assert.AreEqual(3m, result); }