Exemplo n.º 1
0
        public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsCountyCollection AllCounties = new clsCountyCollection();

            //test to see that it exists
            Assert.IsNotNull(AllCounties);
        }
Exemplo n.º 2
0
        public void TwoCountiesPresent()
        {
            //create an instance of the class we want to create
            clsCountyCollection Counties = new clsCountyCollection();

            //test to see tht the two values are the same
            Assert.AreEqual(Counties.Count, 2);
        }
Exemplo n.º 3
0
        public void CountPropertyOK()
        {
            //create an instance of the class we want to create
            clsCountyCollection AllCounties = new clsCountyCollection();
            //create some test data to assign to the property
            Int32 SomeCount = 72;

            //assign the data to the property
            AllCounties.Count = SomeCount;
            //test to see that the two values are the same
            Assert.AreEqual(AllCounties.Count, SomeCount);
        }
Exemplo n.º 4
0
    //function for populating the county drop down list
    void DisplayCounties()
    {
        //create an instance of the County Collection
        clsCountyCollection Counties = new clsCountyCollection();

        //set the data source to the list of counties in the collection
        ddlCounty.DataSource = Counties.AllCounties;
        //set the name of the primary key
        ddlCounty.DataValueField = "CountyNo";
        //set the data field to display
        ddlCounty.DataTextField = "County";
        //bind the data to the list
        ddlCounty.DataBind();
    }
Exemplo n.º 5
0
        public void CountMatchesList()
        {
            //create an instance of the class we want to create
            clsCountyCollection Counties = new clsCountyCollection();
            //create some test data to assign to the property
            //in this case the data needs to be a list of objects
            List <clsCounty> TestList = new List <clsCounty>();
            //add an item to the list
            //create the item of test data
            clsCounty TestItem = new clsCounty();

            //set its properties
            TestItem.CountyNo = 1;
            TestItem.County   = "Leicestershire";
            //add the item to the test list
            TestList.Add(TestItem);
            //assign the data to the property
            Counties.AllCounties = TestList;
            //test to see that the two values are the same
            Assert.AreEqual(Counties.Count, TestList.Count);
        }