Exemplo n.º 1
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 AddressNo = 1;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Exemplo n.º 2
0
        public void FindMethodOK()
        {
            //CREATING THE FIND METHOD HANDOUT
            //CREATE AN INSTANCE OF THER CLASS YOU WANT TO CREATE
            clsAddress AnAddress = new clsAddress();
            //Boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use with the method
            Int32 AddressNo = 1;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Exemplo n.º 3
0
        public void TestStreetFound()
        {
            //create an instance of the class we want to create
            clsAddress AnAddress = new clsAddress();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is OK (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 AddressNo = 21;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //check the property
            if (AnAddress.Street != "Test Street")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
Exemplo n.º 4
0
        public void TestAddressNoFound()
        {
            //CREATE AN INSTANCE OF THER CLASS YOU WANT TO CREATE
            clsAddress AnAddress = new clsAddress();
            //Boolean variable to store the result of the search
            Boolean Found = false;
            //Boolean variable to record if data is ok (assume it is)
            Boolean OK = true;
            //create some test data to use with the method
            Int32 AddressNo = 21;

            //invoke the method
            Found = AnAddress.Find(AddressNo);
            //check the address no
            if (AnAddress.AddressNo != 21)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }