Пример #1
0
        public void TestCreateProduct()
        {
            Product          productTest          = new Product(0, "TestCode", "TestName", "", 100, default);
            ValuesController valuesControllerTest = new ValuesController();
            string           result     = valuesControllerTest.CreateProduct(productTest);
            CrudResult       crudResult = JsonConvert.DeserializeObject <CrudResult>(result);

            if (crudResult.id > 0)
            {
                valuesControllerTest.DeleteProduct(crudResult.id);
            }
            Assert.AreEqual("OK", crudResult.Result);
        }