Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            c  = new CustomerReport();
            tl = new TableLayout(pnlTables);
            Start();

            lstServers.Items.Add(new RestServer(15, "Andy"));
            lstWaitList.Items.Add(new Customer("Jack", 6));
            lstServers.SelectedIndex  = lstServers.TopIndex;
            lstWaitList.SelectedIndex = lstWaitList.TopIndex;
            //listBox2.Items.Add("Name 2");
            //listBox2.Items.Add("Name 3");
        }
        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);
        }