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.");
        }
Ejemplo n.º 2
0
        public void TestTotalNotEmpty()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.LoginService = new TestBox();
            form.login.isAuthentic = true;
            form.signInToolStripMenuItem_Click(this, null);

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

            //check
            Assert.IsTrue(form.getTextBox("tbTotal").Text == "11.09", "tbTotal not 0.00.");
            Assert.IsTrue(form.getTextBox("tbSubtotal").Text == "10.46", "tbSubTotal not 0.00.");
        }
Ejemplo n.º 3
0
        public void TestLDAdd()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.LoginService = new TestBox();
            form.login.isAuthentic = true;
            form.signInToolStripMenuItem_Click(this, null);

            //baseline
            int count = form.getListBox("lbLD").Items.Count;
            Assert.IsTrue(form.getListBox("lbLD").Items.Count > 0, "lbLD has no item.");
            Assert.IsTrue(form.getListBox("lbLD").SelectedIndex == 0, "lbLD selected index not 0.");

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

            //check
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count > 0, "lbOrder has no item.");
            Assert.IsTrue(form.getListBox("lbOrder").SelectedIndex == 0, "lbOrder selected item not 0.");
            Assert.AreEqual(form.getListBox("lbLD").SelectedItem, form.getListBox("lbOrder").SelectedItem, "Selected item from lbLD not moved to lbOrder.");
            Assert.AreEqual(form.getListBox("lbLD").Items.Count, count, "Item removed from lbLD");
            Assert.IsTrue(form.prices.Count == 1, "Prices empty");
        }
Ejemplo n.º 4
0
        public void TestTotalNotEmpty()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();

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

            //check
            Assert.IsTrue(form.getTextBox("tbTotal").Text == "11.09", "tbTotal not 0.00.");
            Assert.IsTrue(form.getTextBox("tbSubtotal").Text == "10.46", "tbSubTotal not 0.00.");
        }
Ejemplo n.º 5
0
        public void TestLDAdd()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.bLD_Click(this, null);

            int count = form.getListBox("lbLD").Items.Count;

            //check
            Assert.IsTrue(form.getListBox("lbLD").Items.Count > 0, "lbLD has no item.");
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count > 0, "lbOrder has no item.");
            Assert.IsTrue(form.getListBox("lbOrder").SelectedIndex == 0, "lbOrder selected item not 0.");
            Assert.AreEqual(form.getListBox("lbLD").SelectedItem, form.getListBox("lbOrder").SelectedItem, "Selected item from lbLD not moved to lbOrder.");
            Assert.AreEqual(form.getListBox("lbLD").Items.Count, count, "Item removed from lbLD");
            Assert.IsTrue(form.prices.Count == 1, "Prices empty");
        }