예제 #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");
        }
예제 #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");
        }
예제 #3
0
        public void testApiCreatedCategoryIsInTheCategoriesList()
        {
            Category category = new Category("Category" + RandomStringUtil.RandomAlphaNumericString(5));

            DoApiLogin();
            CategoryActions.CreateCategoryViaApi(category);
            category.stock = 0;

            List <Category> categories = jsonDeserializer.Deserialize <List <Category> >(RestAdapter.GET("/Category/Index"));

            CollectionAssert.Contains(categories, category, "Created category is not in categories list");
        }