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

            //test to see that it exists
            Assert.IsNotNull(ACounty);
        }
Exemplo n.º 2
0
        public void CountyNoPropertyOK()
        {
            //create an instance of the class we want to create
            clsCounty ACounty = new clsCounty();
            //create some test data to assign to the property
            Int32 CountyNo = 1;

            //assign the data to the property
            ACounty.CountyNo = CountyNo;
            //test to see that the values are the same
            Assert.AreEqual(ACounty.CountyNo, CountyNo);
        }
Exemplo n.º 3
0
        public void CountyPropertyOK()
        {
            //create an instance of the class we want to create
            clsCounty ACounty = new clsCounty();
            //create some test data to assign to the property
            string SomeCounty = "Leicestershire";

            //assign the data to the property
            ACounty.County = SomeCounty;
            //test to see that the values are the same
            Assert.AreEqual(ACounty.County, SomeCounty);
        }
Exemplo n.º 4
0
        public void CountyMinBoundary()
        {
            //create an instance of the class we want to create
            clsCounty ACounty = new clsCounty();
            //create a string variable to store the result of the validation
            String Error = "";
            //create some test data to test the method
            string SomeCounty = "a";

            //invoke the method
            Error = ACounty.Valid(SomeCounty);
            //test to see that the result is OK i.e there was no error message returned
            Assert.AreEqual(Error, "");
        }
Exemplo n.º 5
0
        public void CountyMinLessOne()
        {
            //create an instance of the class we want to create
            clsCounty ACounty = new clsCounty();
            //create a string variable to store the result of the validation
            String Error = "";
            //create some test data to test the method
            string SomeCounty = "";

            //invoke the method
            Error = ACounty.Valid(SomeCounty);
            //test to see that the result is NOT OK i.e there should be an error message
            Assert.AreNotEqual(Error, "");
        }
Exemplo n.º 6
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsCounty ACounty = new clsCounty();
            //boolean variable to store the result of the validtin
            Boolean Found = false;
            //create Some test data to use with the method
            Int32 CountyNo = 1;

            //invoke the method
            Found = ACounty.Find(CountyNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Exemplo n.º 7
0
        public void CountyEtremeMax()
        {
            //create an instance of the class we want to create
            clsCounty ACounty = new clsCounty();
            //create a string variable to store the result of the validation
            String Error = "";
            //create some test data to test the method
            string SomeCounty = "";

            //pad the string with characters
            SomeCounty = SomeCounty.PadRight(500, 'a');
            //invoke the method
            Error = ACounty.Valid(SomeCounty);
            //test to see that the result is NOT OK i.e there should be an error message
            Assert.AreNotEqual(Error, "");
        }
Exemplo n.º 8
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);
        }