コード例 #1
0
ファイル: UnitTest1.cs プロジェクト: KieranFL/DAFranklin
        public void FindMethod()
        {
            //create an instance of the class we want to create
            ClsClothes ClothingItem = new ClsClothes();

            ClothingItem.Find(2);
            string ClothesName = ClothingItem.ClothesName;
            //boolean variable to store the result of the validation
            Boolean Found = false;
            // create some test data to use with the method
            Int32 ProductNo = 1;

            //invoke the method
            Found = ClothingItem.Find(ProductNo);
            //test to see that the result is correct
            Assert.IsTrue(Found);
        }
コード例 #2
0
ファイル: UnitTest1.cs プロジェクト: KieranFL/DAFranklin
        public void TestProductNoFound()
        {
            //create an instance of the class we want to create
            ClsClothes ClothingItem = new ClsClothes();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to record if data is ok
            Boolean OK = true;
            //create some test data to use with the method
            Int32 ProductNo = 1;

            //invoke the method
            Found = ClothingItem.Find(ProductNo);
            //check the Product no
            if (ClothingItem.ProductNo != 1)
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }