Пример #1
0
        public void InstanceOK()
        {
            //create an instance of our class clsCustomer
            clsTownCollection AllTowns = new clsTownCollection();

            //check to see that the class it exists
            Assert.IsNotNull(AllTowns);
        }
Пример #2
0
        public void CountPropertyOK()
        {
            //create an instance of our class clsCustomer
            clsTownCollection AllTowns = new clsTownCollection();
            //create some test data
            Int32 SomeCount = 1;

            //assign the data
            AllTowns.Count = SomeCount;
            //check to see that the two values are the same
            Assert.AreEqual(AllTowns.Count, SomeCount);
        }
Пример #3
0
        public void CountMatchesList()
        {
            //create an instance of our class clsCustomer
            clsTownCollection Towns = new clsTownCollection();
            //create some test data to assign the property
            //in this case the data needs to be a list of objects
            List <clsTown> TestList = new List <clsTown>();
            //add an item to the lsit
            //create the item of test data
            clsTown TestItem = new clsTown();

            //set its propeties
            TestItem.TownNo = 1;
            TestItem.Town   = "Leicester";
            //add the item to the test list
            TestList.Add(TestItem);
            //assign the data to the property
            Towns.AllTowns = TestList;
            //test to see that the two values are the same
            Assert.AreEqual(Towns.AllTowns, TestList);
        }