Exemple #1
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsProducts AProduct = new clsProducts();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some test data to use woth the method
            Int32 ProductID = 10;

            //invoke the method
            Found = AProduct.Find(ProductID);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
Exemple #2
0
        public void TestProductIDFound()
        {
            //create an instance of the class we want to create
            clsProducts AProduct = new clsProducts();
            //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 ProductID = 10;

            //invoke the method
            Found = AProduct.Find(ProductID);
            //check the productID
            if (AProduct.ProductID != 10)
            {
                OK = false;
            }
            //test to seee that the result is correct
            Assert.IsTrue(OK);
        }