Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public BackUpCommand(Context context, RobotSnapshot robotSnapshot)
 {
     this.context       = context;
     this.robotSnapshot = robotSnapshot;
 }
Exemplo n.º 3
0
 public void AddSnaphot(RobotSnapshot robotSnapshot)
 {
     robotSnapshots.Add(robotSnapshot);
 }