public void LogoutTest() { UserTable ut = CreateUser(89, "eeeo"); IUser user = ConvertToIUser(ut); _userDataProxy.AddNewUser(user); _userDataProxy.Logout(user); Console.WriteLine(user.Id() + user.Name() + user.MemberName() + user.Password() + user.Points() + user.Money() + user.Email() + user.WinNum + 0 + user.HighestCashGainInGame + user.TotalProfit + user.Avatar() + user.GetNumberOfGamesUserPlay() + user.IsLogin() + user.GetLeague()); IUser t = _userDataProxy.GetUserById(89); Assert.IsFalse(t.IsLogin()); _userDataProxy.DeleteUserById(89); }
//Use-Case: user can logput from system public IUser LogoutUser(int userId) { IUser user = _sc.GetUserWithId(userId); if (user == null || !user.IsLogin()) { return(user); } var toReturn = user.Logout(); if (toReturn) { _userDataProxy.Logout(user); return(user); } return(null); }