Example #1
0
        public void ImportBooks_When_ShopDoesNotExist_ReturnsNotFound()
        {
            var request  = BookRequestHelper.ImportBooks("UnexistingShop", "test.xlsx", @"Books/test.xlsx");
            var response = this.restClient.Execute <ImportBooksResponse>(request);

            Assert.AreEqual(HttpStatusCode.NotFound, response.StatusCode);
        }
Example #2
0
        public void ImportBooks_When_ExcelIsCorrectButBooksAlreadyExists_ReturnsCreated()
        {
            var request  = BookRequestHelper.ImportBooks(this.shop, "test.xlsx", @"Books/test.xlsx");
            var response = this.restClient.Execute <ImportBooksResponse>(request);

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);
            Assert.NotNull(response.Data);
            Assert.AreEqual(0, response.Data.BooksInserted);
            Assert.AreEqual(7, response.Data.TotalBooks);
        }