Esempio 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);
        }
Esempio n. 2
0
 public void SetState(State state)
 {
     this.State = state;
 }
Esempio n. 3
0
 public Context()
 {
     State          = StateFactory.Create(EState.START, this);
     robotSnapshots = new List <RobotSnapshot>();
 }