public void SeedBook() { var book = new Book(33, "autoAuthor", "autoTitle", "autoDescription"); ScenarioContext.Current.Set <Book>(book, "seededBook"); ResponseCodeAndPayload <Book> response = CrudBook.PostNewBook(book); ExceptionHandler.ThrowIfStatusCodeNotOk(response.ResponseCode); }
public void SeedBooks() { List <Book> books = new List <Book>(); for (int i = 1; i <= 10; i++) { books.Add(new Book(i, "autoAuthor" + i, "autoTitle" + i, "autoDescription" + i)); } ScenarioContext.Current.Set <List <Book> >(books, "seededBooks"); foreach (var book in books) { ResponseCodeAndPayload <Book> response = CrudBook.PostNewBook(book); ExceptionHandler.ThrowIfStatusCodeNotOk(response.ResponseCode); } }
public void WhenCreateBookRequestIsExecuted() { ResponseCodeAndPayload <Book> responseCodeAdnPayload = CrudBook.PostNewBook(ScenarioContext.Current.Get <Book>("testedBook")); ScenarioContext.Current.Set <ResponseCodeAndPayload <Book> >(responseCodeAdnPayload, "responseCodeAdnPayload"); }