Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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");
        }