Ejemplo n.º 1
0
        private void Form1_Click(object sender, EventArgs e)
        {
            Button s = (Button)sender;
            Table  t = (Table)s.Tag;

            if (chkRemove.Checked)
            {
                s.Text = "Table " + Convert.ToString(t.TableID);
            }
            else
            {
                t.Serv = (RestServer)lstServers.SelectedItem;
                t.AssignCustomer((Customer)lstWaitList.SelectedItem);
                s.Text = t.Party.ToString() + "\n" + t.Serv.ToString();
                c.AddToCustomerTotal(t.Party.PartySize);
                lstWaitList.Items.Remove(lstWaitList.SelectedItem);
                //s.Text = t.ToString();
            }
        }
        public void MakeCustomerReport_WithValidatedPartySize()
        {
            int  testCustomerTotal;
            bool isCorrectPartySize = false;

            CustomerReport testCustomerReport = new CustomerReport();

            testCustomerReport.AddToCustomerTotal(3);
            testCustomerTotal = testCustomerReport.CustomerTotal;

            if (testCustomerTotal == 3)
            {
                isCorrectPartySize = true;
            }
            else
            {
                isCorrectPartySize = false;
            }


            Assert.IsTrue(isCorrectPartySize);
        }
        public void MakeCustomerReport_WithValidatedToString()
        {
            string testCustomerString;
            string testCustomerString2;
            bool   isCorrectString = false;

            CustomerReport testCustomerReport = new CustomerReport();

            testCustomerReport.AddToCustomerTotal(3);
            testCustomerString  = testCustomerReport.ToString();
            testCustomerString2 = "Report: Total Customers: " + testCustomerReport.CustomerTotal.ToString();

            if (testCustomerString == testCustomerString2)
            {
                isCorrectString = true;
            }
            else
            {
                isCorrectString = false;
            }


            Assert.IsTrue(isCorrectString);
        }