コード例 #1
0
        public void ReportByNameMethodNoneFound()
        {
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByName("yyy");
            Assert.AreEqual(0, FilteredCustomers.Count);
        }
コード例 #2
0
        public void ReportByNameTestDataFound()
        {
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();
            Boolean OK = true;

            FilteredCustomers.ReportByName("test");

            if (FilteredCustomers.Count == 2)
            {
                if (FilteredCustomers.CustomerList[0].CustomerId != 17)
                {
                    OK = false;
                }

                if (FilteredCustomers.CustomerList[1].CustomerId != 18)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
コード例 #3
0
        public void ReportByNameDataFound()
        {
            //filtered data instance
            clsCustomerCollection FilteredNames = new clsCustomerCollection();
            Boolean OK = true;

            //apply a name from the list
            FilteredNames.ReportByName("a");
            if (FilteredNames.Count == 1)
            {
                //ID of customer is 16
                if (FilteredNames.CustomerList[0].CustomerId != 16)
                {
                    OK = false;
                }

                //ID of customer is 19
                if (FilteredNames.CustomerList[1].CustomerId != 19)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
コード例 #4
0
        public void ReportByNameMethodOK()
        {
            clsCustomerCollection AllCustomers      = new clsCustomerCollection();
            clsCustomerCollection FilteredCustomers = new clsCustomerCollection();

            FilteredCustomers.ReportByName("");
            Assert.AreEqual(AllCustomers.Count, FilteredCustomers.Count);
        }
コード例 #5
0
        public void ReportByNameNoneFound()
        {
            //filtered data instance
            clsCustomerCollection FilteredNames = new clsCustomerCollection();

            //apply a name that does not exist
            FilteredNames.ReportByName("abc");
            //test to see that there are no records
            Assert.AreEqual(0, FilteredNames.Count);
        }
コード例 #6
0
        public void ReportByNameOK()
        {
            //normal instance
            clsCustomerCollection AllCustomers = new clsCustomerCollection();
            //filtered data instance
            clsCustomerCollection FilteredNames = new clsCustomerCollection();

            //empty filtered name
            FilteredNames.ReportByName("");
            Assert.AreEqual(AllCustomers.Count, FilteredNames.Count);
        }
コード例 #7
0
        public void ReportByNameOK()
        {
            clsCustomerCollection filteredCustomers = new clsCustomerCollection();

            Boolean OK = true;

            filteredCustomers.ReportByName(""); //?????????

            if (filteredCustomers.Count == 2)
            {
                if (filteredCustomers.CustomerList[0].CustomerId != 2)
                {
                    OK = false;
                }

                if (filteredCustomers.CustomerList[1].CustomerId != 3)
                {
                    OK = false;
                }
            }

            Assert.IsTrue(OK);
        }