public void checkRemoveProduct() { log.Info("Start check remove product test"); // prepare string product = "18"; string expertedResult = "null"; // action string result = Sql_request.checkProduct(product); //verefication Assert.AreEqual(result, expertedResult); log.Info("End check remove product test"); }
public void checkProduct() { log.Info("Start check product test"); readToken(); // prepare string expertedResult = "18"; // action string result = Sql_request.checkProduct(expertedResult); //verefication Assert.AreEqual(result, expertedResult); log.Info("End check product test"); }
public void removeProductFromCart() { log.Info("Start remove product test"); readToken(); var client = new RestClient("http://localhost/opencart/index.php?route=api/cart/remove&api_token=" + apiToken); client.Timeout = -1; var request = new RestRequest(Method.POST); string productID = Sql_request.getPructID(apiToken); try { request.AddHeader("Cookie", "OCSESSID=4694d5e74bbdbca0950ab5d503; currency=USD; language=en-gb"); request.AddParameter("key", productID); IRestResponse response = client.Execute(request); } catch (Exception e) { log.Error("The product was not remove. Kode(" + e.Message + ")"); Console.WriteLine(e.Message); } log.Info("End remove product test"); }