private void CreateRoomLoop1() { string pass = "******"; string email = "*****@*****.**"; string name = "99999" + Thread.CurrentThread.ManagedThreadId.ToString(); int id = UserBridge.RegisterUser(name, pass, email); Assert.True(id != -1); Assert.True(UserBridge.LoginUser(name, pass)); int RoomID; List <int> roomIDS = new List <int>(); for (int i = 8850000; i < 8850100; i++) { RoomID = GameBridge.CreateGameRoom(id, 100); roomIDS.Add(RoomID); } for (int i = 0; i < roomIDS.Count; i++) { GameBridge.DoAction(id, CommunicationMessage.ActionType.Leave, 0, roomIDS[i]); } Assert.True(UserBridge.LogoutUser(id)); UserBridge.DeleteUser(name, pass); }
public void UserLoginTestGood() { UserId = new Random().Next(); User1Name = "orelie" + UserId; User1Pw = "goodPw1234"; UserEmailGood1 = "*****@*****.**"; RegisterUser1(); Assert.True(UserBridge.LoginUser(User1Name, User1Pw)); UserBridge.DeleteUser(UserId); }
private void RegisterUser(int userId, string name, string pass, string mail) { if (!UserBridge.IsThereUser(userId)) { UserBridge.RegisterUser(userId, name, pass, mail); Users.Add(userId); } else if (!UserBridge.IsUserLoggedIn(userId)) { UserBridge.LoginUser(name, pass); } }
private void RegisterAndLoginLoop() { string pass = "******"; string email = "*****@*****.**"; string name = Thread.CurrentThread.ManagedThreadId.ToString(); int id; for (int i = 6850000; i < 6850100; i++) { id = UserBridge.RegisterUser(i + name, pass, email); Assert.True(id != -1); Assert.True(UserBridge.LoginUser(i + name, pass)); Assert.True(UserBridge.LogoutUser(id)); UserBridge.DeleteUser(i + name, pass); } }
public void UserLoginTestBad() { Assert.False(UserBridge.LoginUser("", "")); Assert.False(UserBridge.LoginUser("אני שם בעברית", User1Pw)); }