Example #1
0
        public void testApiDeleteCategoryRestResponse()
        {
            Category category = new Category("Category" + RandomStringUtil.RandomAlphaNumericString(5));

            DoApiLogin();
            CategoryActions.CreateCategoryViaApi(category);

            Assert.AreEqual(HttpStatusCode.OK, RestAdapter.DELETE(String.Format("/Category/Delete/{0}", category.categoryId)).StatusCode,
                            "Category deletion failed");
        }
Example #2
0
        public void testApiDeletedCategoryIsNotInCategoriesList()
        {
            Category category = new Category("Category" + RandomStringUtil.RandomAlphaNumericString(5));

            DoApiLogin();
            CategoryActions.CreateCategoryViaApi(category);
            category.stock = 0;
            RestAdapter.DELETE(String.Format("/Category/Delete/{0}", category.categoryId));
            List <Category> categories = jsonDeserializer.Deserialize <List <Category> >(RestAdapter.GET("/Category/Index"));

            CollectionAssert.DoesNotContain(categories, category, "Deleted category is in categories list");
        }