public void TestInit()
 {
     data = new HotelBookingSystemData();
     admin = new User("administrator", "Password123", Roles.VenueAdmin);
     user = new User("newUser", "Password123", Roles.User);
     usersController = new UsersController(data, admin);
 }
        public void Authorize_LogoutUser_ReturnsCurrentUserIsNull()
        {
            var controller = new UsersController(data, user);

            controller.Logout();
            var result = controller.CurrentUser;

            Assert.IsNull(result);
        }
        public void Logout_LogoutExistingUser_ShouldLogoutUser()
        {
            var controller = new UsersController(data, user);

            controller.Logout();
            var result = controller.CurrentUser;

            Assert.IsNull(result);
        }
 public void Logout_LogoutNonExistingUser_ShouldThrow()
 {
     var controller = new UsersController(data, null);
     controller.Logout();
 }
        public void TestLogout_WithoutLoggedUser_ShouldThrow()
        {
            var db = new HotelBookingSystemData();
            var controller = new UsersController(db, null);

            controller.Logout();
        }
        public void TestLogout_WithLoggedUser_CurrentUserIsNull()
        {
            var db = new HotelBookingSystemData();
            var controller = new UsersController(db, null);

            controller.Logout();
            var user = controller.CurrentUser;
            Assert.IsNull(user);
        }