示例#1
0
文件: UnitTest1.cs 项目: djvorr/SSE
        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.");
        }
示例#2
0
文件: UnitTest1.cs 项目: djvorr/SSE
        public void ListBoxesLoad()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();

            //check
            Assert.IsTrue(form.getListBox("lbBreakfast").Items.Count > 0, "lbBreakfast is empty.");
            Assert.IsTrue(form.getListBox("lbBreakfast").SelectedIndex == 0, "lbBreakfast selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbLD").Items.Count > 0, "lbLD is empty.");
            Assert.IsTrue(form.getListBox("lbLD").SelectedIndex == 0, "lbLD selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbDrinks").Items.Count > 0, "lbDrinks is empty.");
            Assert.IsTrue(form.getListBox("lbDrinks").SelectedIndex == 0, "lbDrinks selected index is not.");

            Assert.IsTrue(form.getListBox("lbDessert").Items.Count > 0, "lbDesserts is empty.");
            Assert.IsTrue(form.getListBox("lbDessert").Items.Count > 0, "lbDesserts selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 0, "lbOrder is not empty.");
        }
示例#3
0
文件: UnitTests.cs 项目: djvorr/SSE
        public void ListBoxesLoad()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.LoginService = new TestBox();
            form.login.isAuthentic = true;
            form.signInToolStripMenuItem_Click(this, null);

            //check
            Assert.IsTrue(form.getListBox("lbBreakfast").Items.Count > 0, "lbBreakfast is empty.");
            Assert.IsTrue(form.getListBox("lbBreakfast").SelectedIndex == 0, "lbBreakfast selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbLD").Items.Count > 0, "lbLD is empty.");
            Assert.IsTrue(form.getListBox("lbLD").SelectedIndex == 0, "lbLD selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbDrinks").Items.Count > 0, "lbDrinks is empty.");
            Assert.IsTrue(form.getListBox("lbDrinks").SelectedIndex == 0, "lbDrinks selected index is not.");

            Assert.IsTrue(form.getListBox("lbDessert").Items.Count > 0, "lbDesserts is empty.");
            Assert.IsTrue(form.getListBox("lbDessert").Items.Count > 0, "lbDesserts selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 0, "lbOrder is not empty.");
        }
示例#4
0
文件: UnitTest1.cs 项目: djvorr/SSE
        public void TestBreakfastAdd()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.bBreakfast_Click(this, null);

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

            //check
            Assert.IsTrue(form.getListBox("lbBreakfast").Items.Count > 0, "lbBreakfast 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("lbBreakfast").SelectedItem, form.getListBox("lbOrder").SelectedItem, "Selected item from lbBreakfast not moved to lbOrder.");
            Assert.AreEqual(form.getListBox("lbBreakfast").Items.Count, count, "Item removed from lbBreakfast");
            Assert.IsTrue(form.prices.Count == 1, "Prices empty");
        }
示例#5
0
文件: UnitTests.cs 项目: djvorr/SSE
        public void TestBreakfastAdd()
        {
            //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("lbBreakfast").Items.Count;
            Assert.IsTrue(form.getListBox("lbBreakfast").Items.Count > 0, "lbBreakfast has no item.");
            Assert.IsTrue(form.getListBox("lbBreakfast").SelectedIndex == 0, "lbBreakfast selected item not zero.");

            //action
            form.bBreakfast_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("lbBreakfast").SelectedItem, form.getListBox("lbOrder").SelectedItem, "Selected item from lbBreakfast not moved to lbOrder.");
            Assert.AreEqual(form.getListBox("lbBreakfast").Items.Count, count, "Item removed from lbBreakfast");
            Assert.IsTrue(form.prices.Count == 1, "Prices empty");
        }
示例#6
0
文件: UnitTests.cs 项目: djvorr/SSE
        public void TestTranslate()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.LoginService = new TestBox();
            form.login.isAuthentic = true;
            form.signInToolStripMenuItem_Click(this, null);

            //Action
            form.spanishToolStripMenuItem_Click(this, null);

            //Check
            Assert.IsTrue(form.getListBox("lbDessert").Items[3].ToString().CompareTo("Volumen de negocios de manzana caliente $22.65") == 0, "Dessert did not translate");
            Assert.IsTrue(form.getListBox("lbDrinks").Items[0].ToString().CompareTo("Bebidas $29.67") == 0, "Drink did not translate");
            Assert.IsTrue(form.getListBox("lbLD").Items[2].ToString().CompareTo("queso Pancho $40.21") == 0, "Lunch/Dinner did not translate");
            Assert.IsTrue(form.getListBox("lbBreakfast").Items[0].ToString().CompareTo("sandwich de huevo w/ Tocino $52.50") == 0, "Breakfast did not translate");
        }
示例#7
0
文件: UnitTests.cs 项目: djvorr/SSE
        public void TestRemove()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.LoginService = new TestBox();
            form.login.isAuthentic = true;
            form.signInToolStripMenuItem_Click(this, null);

            form.bBreakfast_Click(this, null);
            form.bBreakfast_Click(this, null);

            //baseline
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 2, "lbOrder count not 2");
            Assert.IsTrue(form.prices.Count == 2, "Prices count not 2");

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

            //check
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 1, "lbOrder count not 1");
            Assert.IsTrue(form.prices.Count == 1, "Prices count not 1");
        }
示例#8
0
文件: UnitTests.cs 项目: djvorr/SSE
        public void TestLogin()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();
            form.LoginService = new TestBox();
            form.login.isAuthentic = true;
            form.signInToolStripMenuItem_Click(this, null);
            //form.login.Show();
            //form.login.MessageBoxService = new TestBox() as IMessageBoxService;
            //form.login.tbPass.Text = "alf1";
            //form.login.tbUser.Text = "jalf";
            //form.login.bSignIn_Click(this, null);

            Assert.IsTrue(form.getListBox("lbBreakfast").Items.Count > 0, "lbBreakfast is empty.");
            Assert.IsTrue(form.getListBox("lbBreakfast").SelectedIndex == 0, "lbBreakfast selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbLD").Items.Count > 0, "lbLD is empty.");
            Assert.IsTrue(form.getListBox("lbLD").SelectedIndex == 0, "lbLD selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbDrinks").Items.Count > 0, "lbDrinks is empty.");
            Assert.IsTrue(form.getListBox("lbDrinks").SelectedIndex == 0, "lbDrinks selected index is not.");

            Assert.IsTrue(form.getListBox("lbDessert").Items.Count > 0, "lbDesserts is empty.");
            Assert.IsTrue(form.getListBox("lbDessert").Items.Count > 0, "lbDesserts selected index is not 0.");

            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 0, "lbOrder is not empty.");
        }
示例#9
0
文件: UnitTest1.cs 项目: djvorr/SSE
        public void TestRemove()
        {
            //setup
            NuWayOrderForm form = new NuWayOrderForm();
            form.Show();

            form.bBreakfast_Click(this, null);
            form.bBreakfast_Click(this, null);

            //baseline
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 2, "lbOrder count not 2");
            Assert.IsTrue(form.prices.Count == 2, "Prices count not 2");

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

            //check
            Assert.IsTrue(form.getListBox("lbOrder").Items.Count == 1, "lbOrder count not 1");
            Assert.IsTrue(form.prices.Count == 1, "Prices count not 1");
        }