public void AddAndDeleteSupport() { supportService.AddSupportToDatabase(constants.getSupport()); int id = supportService.GetSupportByTitleAndAuthor(constants.getSupport().Title, constants.getSupport().WritenBy); Assert.NotNull(supportService.getSupportById(id)); supportService.deleteSupportFromDatabase(id); Assert.Null(supportService.getSupportById(id)); }
public ActionResult createSupportMessage([FromBody] Support support) { if (validationService.idValdation(support.WritenBy) && validationService.textValidation(support.Title) && validationService.textValidation(support.Summary)) { if (validationService.objectValidation(support)) { supportService.AddSupportToDatabase(support); return(Created("", support)); } return(NotFound(ErrorService.GetError("User can not be found"))); } return(NotFound(ErrorService.GetError("UserId, Title and summary can not be empty"))); }
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)); }