Ejemplo n.º 1
0
        public void TestClear()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();

            form.bBreakfast_Click(this, null);
            form.bDrinks_Click(this, null);
            form.bLD_Click(this, null);
            form.bDessert_Click(this, null);

            //baseline
            Assert.IsTrue(form.getTextBox("tbTotal").Text == "11.09", "tbTotal not accurate");
            Assert.IsTrue(form.getTextBox("tbSubtotal").Text == "10.46", "tbSubTotal not accurate.");
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 4, "4 Items not added.");
            Assert.IsTrue(form.prices.Count == 4, "prices not 4.");

            //action
            form.bClear_Click(this, null);

            //checks
            Assert.IsTrue(form.getTextBox("tbTotal").Text == "0.00", "tbTotal not 0.00.");
            Assert.IsTrue(form.getTextBox("tbSubtotal").Text == "0.00", "tbSubTotal not 0.00.");
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 0, "4 Items not added");
            Assert.IsTrue(form.prices.Count == 0, "prices not empty.");
        }