public void EqualsCommandInClearStateShouldBeInvariantTest() { var calc = CalculatorFactory.BuildNew(); var state = new ClearState(calc); state.Notify(new EqualsCommand()); Assert.IsTrue(calc.State is ClearState); }
public void PointCommandShouldSetAccumulatorTest() { var calc = CalculatorFactory.BuildNew(); var state = new ClearState(calc); Assert.IsTrue(calc.CPU.Accumulator.IsEmpty); state.Notify(PointCommand.Instance); Assert.IsTrue(calc.State is AccumulatorState); Assert.IsTrue(calc.CPU.Accumulator.ToString() == "0."); }