public void AddAndTestData() { //Connect to the test database Client client = new Client("JpczLFGlL0", "JpczLFGlL0", "TjTWsNqWOZ"); //Get all the existing products List <Product> products = client.GetProducts(); //Delete all the products client.DeleteProducts(products); //Check we deleted all the products products = client.GetProducts(); Assert.IsTrue(products.Count == 0); //Insert test data client.InsertTestData(); //Check they were correctly inserted products = client.GetProducts(); Assert.IsTrue(products.Count == 2); //addNewProduct client.addNewProduct("Pera", 0, 1); //Check correctly created products = client.GetProducts(); Assert.IsTrue(products.Count == 3); products = client.getSoldOut(); Assert.IsTrue(products.Count == 1); }
public void TestWriteDownProducts() { // Connect to the test database Client client = new Client("pBRMsmc7h2", "pBRMsmc7h2", "mQvsG2x5NR"); //Get all the existing products List <Product> productosPedidos = client.GetProducts(); client.DeleteProducts(productosPedidos); //Check we deleted all the products productosPedidos = client.GetProducts(); Assert.IsTrue(productosPedidos.Count == 0); //Insert test data client.InsertTestData(); //Check they were correctly inserted productosPedidos = client.GetProducts(); Assert.IsTrue(productosPedidos.Count == 2); }
public void AddAndTestData() { //Connect to the test database Client client = new Client("NLphb4HrH0", "NLphb4HrH0", "VM8GYV3qZ7"); //Get all the existing products List <Product> products = client.GetProducts(); //Delete all the products client.DeleteProducts(products); //Check we deleted all the products products = client.GetProducts(); Assert.IsTrue(products.Count == 0); //Insert test data client.InsertTestData(); //Check they were correctly inserted products = client.GetProducts(); Assert.IsTrue(products.Count == 2); }