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 BackUpCommand(Context context, RobotSnapshot robotSnapshot) { this.context = context; this.robotSnapshot = robotSnapshot; }
public void AddSnaphot(RobotSnapshot robotSnapshot) { robotSnapshots.Add(robotSnapshot); }