Example #1
0
        public void CreateNewEventTest()
        {
            int count = eventService.getAllEventsCount() + 1;

            eventService.createNewEvent(
                constants.getTestEvent().title,
                constants.getTestEvent().summary,
                constants.getTestEvent().CreatedBy);
            Assert.Equal(count, eventService.getAllEventsCount());
        }
Example #2
0
        public void clearDB()
        {
            while (userService.getUserByNameAndPassword(testConstants.getUser().Name, testConstants.getUser().Password) != null)
            {
                userService.deleteUserById(userService.getIdByNameAndPassword(new string[] { testConstants.getUser().Name, testConstants.getUser().Password }));
            }

            while (eventService.getEventByTitleAndAuthor(testConstants.getTestEvent().title, testConstants.getTestEvent().CreatedBy) != null)
            {
                eventService.deleteEvent(eventService.getEventIdByTitleAndAuthor(testConstants.getTestEvent().title, testConstants.getTestEvent().CreatedBy));
            }
        }
Example #3
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 #4
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));
        }