public void MakeSnapshotCommandTest() { StartGameCommandTest(); int snaphotCount = _context.GetRobotSnapshots().Count; _robotMemento = _context.Robot; _stateMemento = _context.State; ICommand makeSnapshotCommand = new MakeSnapshotCommand(_context); makeSnapshotCommand.Execute(); _robotSnapshot = _context.GetRobotSnapshots()[snaphotCount]; Assert.IsTrue(snaphotCount + 1 == _context.GetRobotSnapshots().Count); Assert.IsTrue(_context.State is DecidingState); }
public void SetState(State state) { this.State = state; }
public Context() { State = StateFactory.Create(EState.START, this); robotSnapshots = new List <RobotSnapshot>(); }