public void DeleteSeededBook() { var book = ScenarioContext.Current.Get <Book>("seededBook"); var response = CrudBook.DeleteBook(book.Id); ExceptionHandler.ThrowIfStatusCodeNotNoContent(response.ResponseCode); }
public void GivenBookIsDeletedById(int id) { Book deletedBook = CrudBook.GetBook(id).PayLoadObject; ResponseCodeAndPayload <ResponseMessageContent> deletedRequestMessage = CrudBook.DeleteBook(id); ScenarioContext.Current.Set <Book>(deletedBook, "deletedBook"); ScenarioContext.Current.Set <ResponseCodeAndPayload <ResponseMessageContent> > (deletedRequestMessage, "deletedRequestMessage"); }
public void DeleteAllBooks() { List <Book> books = CrudBook.GetAllBooks().PayLoadObject; foreach (var book in books) { ExceptionHandler.ThrowIfStatusCodeNotNoContent(CrudBook.DeleteBook(book.Id).ResponseCode); } }