예제 #1
0
        private void btnShowReport_Click(object sender, EventArgs e)
        {
            //we'll call this method elsewhere, but it works
            //c.AddToCustomerTotal(3);
            CReport cr = new CReport();

            cr.lblReport.Text = c.ToString();
            cr.Show();
        }
        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);
        }