Esempio n. 1
0
 public void GetReplayableGamesTestSad()
 {
     //RestartSystem();
     SetupUser1();
     //  Assert.True(RoomId == -1);
     Assert.True(ReplayBridge.GetReplayableGames(RoomId, 0, UserId) == null);
 }
Esempio n. 2
0
        public void ViewReplayTestGood()
        {
            //create a game to be replayd
            //RestartSystem();
            SetupUser1();
            CreateGameWithUser1();
            RegisterUser(_userId2, _user2Name, _user2Pw, _user2EmailGood);
            IUser user2 = UserBridge.getUserById(_userId2);

            user2.AddMoney(1000);
            Assert.True(UserBridge.AddUserToGameRoomAsPlayer(_userId2, RoomId, user2.Money()));
            GameBridge.StartGame(UserId, RoomId);
            //   UserBridge.RemoveUserFromRoom(UserId, RoomId);

            var replays = ReplayBridge.ViewReplay(RoomId, 0, UserId);

            Assert.GreaterOrEqual(6, replays.Count); //join, 2 call, leave, lose, win
        }
Esempio n. 3
0
        public void GetReplayableGamesTestGood()
        {
            //create a game to be replayd
            //RestartSystem();
            SetupUser1();
            CreateGameWithUser1();
            RegisterUser(_userId2, _user2Name, _user2Pw, _user2EmailGood);
            IUser user2 = UserBridge.getUserById(_userId2);

            user2.AddMoney(1000);
            Assert.True(UserBridge.AddUserToGameRoomAsPlayer(_userId2, RoomId, user2.Money()));
            RegisterUser(_userId3, _user3Name, _user3Pw, _user3EmailGood);
            IUser user3 = UserBridge.getUserById(_userId3);

            user3.AddMoney(1000);
            Assert.True(UserBridge.AddUserToGameRoomAsPlayer(_userId3, RoomId, user3.Money()));
            GameBridge.StartGame(UserId, RoomId);
            System.Threading.Thread.Sleep(5000);
            UserBridge.RemoveUserFromRoom(UserId, RoomId);
            UserBridge.RemoveUserFromRoom(_userId2, RoomId);
            UserBridge.RemoveUserFromRoom(_userId3, RoomId);
            Assert.True(ReplayBridge.GetReplayableGames(RoomId, 0, _userId3)._actions.Count >= 1);
        }
Esempio n. 4
0
 public void ViewReplayTestBad()
 {
     //RestartSystem();
     SetupUser1();
     Assert.IsEmpty(ReplayBridge.ViewReplay(RoomId, 0, UserId));
 }