public void ShouldApplyOperatorSuccefully() { CalculatorContainer container = new CalculatorContainer(); CalculatorExecutor executor = new CalculatorExecutor(); container.PushItem(5); container.PushItem(7); container.PushItem(8); executor.ApplyOperator(container, "+"); Assert.AreEqual("5;15", container.PrettyDisplay()); container.PushItem(10); executor.ApplyOperator(container, "-"); Assert.AreEqual("5;-5", container.PrettyDisplay()); executor.ApplyOperator(container, "*"); Assert.AreEqual("-25", container.PrettyDisplay()); }
public void ShouldDisplayStack() { CalculatorContainer container = new CalculatorContainer(); container.PushItem(5); container.PushItem(7); Assert.AreEqual("5;7", container.PrettyDisplay()); }
public string GetStack() { return(CalculatorContainer.PrettyDisplay()); }