Example #1
0
        public void deleteUser()
        {
            authService.createNewUser(constants.getUser().Name, constants.getUser().Password);
            int id = userService.getIdByNameAndPassword(constants.getNameAndPass());

            eventService.createNewEvent(constants.getTestEvent().title, constants.getTestEvent().summary, id);
            int eventId = eventService.getEventIdByTitleAndAuthor(constants.getTestEvent().title, id);

            supportService.AddSupportToDatabase(new Support(constants.getSupport().Title, constants.getSupport().Summary, id));
            userEventsService.joinUserToEvent(id, eventId);

            userService.deleteUserById(id);

            Assert.Null(userService.getUserById(id));
        }
Example #2
0
        public void UserJoinToEventTest()
        {
            authService.createNewUser(constants.getUser().Name, constants.getUser().Password);
            int userId = userService.getIdByNameAndPassword(constants.getNameAndPass());

            eventService.createNewEvent(constants.getTestEvent().title, constants.getTestEvent().summary, constants.getTestEvent().CreatedBy);
            int eventId = eventService.getEventIdByTitleAndAuthor(constants.getTestEvent().title, constants.getTestEvent().CreatedBy);

            userEventsService.joinUserToEvent(userId, eventId);

            Assert.NotNull(userEventsService.getEventByUserIdAndEventId(userId, eventId));

            userEventsService.deleteUserEvent(userId, eventId);

            Assert.Null(userEventsService.getEventByUserIdAndEventId(userId, eventId));
        }