コード例 #1
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);
        }
コード例 #2
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);
            }
        }
コード例 #3
0
        public void WhenCreateBookRequestIsExecuted()
        {
            ResponseCodeAndPayload <Book> responseCodeAdnPayload = CrudBook.PostNewBook(ScenarioContext.Current.Get <Book>("testedBook"));

            ScenarioContext.Current.Set <ResponseCodeAndPayload <Book> >(responseCodeAdnPayload, "responseCodeAdnPayload");
        }