Example #1
0
        public void ReportByPostCodeTestDataFound()
        {
            // create an instance of the filterd data
            ClsAddressCollection FilteredAddresses = new ClsAddressCollection();
            //var to store outcome
            Boolean OK = true;

            //apply a blank string(should return all records)
            FilteredAddresses.ReportByPostCode("yyy yyy");
            //test to see that the two values are the same
            if (FilteredAddresses.Count == 2)
            {
                //check that the first record is ID 36
                if (FilteredAddresses.AddressList[0].AddressNo != 36)
                {
                    OK = false;
                }
                //check that the first record is ID 37
                if (FilteredAddresses.AddressList[1].AddressNo != 37)
                {
                    OK = false;
                }
            }
            else
            {
                OK = false;
            }
            //test to see that ther are no records
            Assert.IsTrue(OK);
        }
Example #2
0
        public void ReportByPostCodeNoneFound()
        {
            // create an instance of the filterd data
            ClsAddressCollection FilteredAddresses = new ClsAddressCollection();

            //apply a blank string(should return all records)
            FilteredAddresses.ReportByPostCode("xxx xxx");
            //test to see that the two values are the same
            Assert.AreEqual(0, FilteredAddresses.Count);
        }
Example #3
0
        public void ReportByPostCodeMethodOK()
        {
            //create an instance of the class contsaing unfiltered results
            ClsAddressCollection AllAddresses = new ClsAddressCollection();
            // create an instance of the filterd class
            ClsAddressCollection FilteredAddresses = new ClsAddressCollection();

            //apply a blank string(should return all records)
            FilteredAddresses.ReportByPostCode("");
            //test to see that the two values are the same
            Assert.AreEqual(AllAddresses.Count, FilteredAddresses.Count);
        }