예제 #1
0
        public void FindMethodOk2()
        {
            clsProduct AProduct  = new clsProduct();
            Boolean    Found     = false;
            Int32      ProductNo = 1;

            Found = AProduct.Find(ProductNo);
            Assert.IsTrue(Found);
        }
예제 #2
0
        public void FindMethodOK()
        {
            clsProduct AProduct   = new clsProduct();
            Boolean    Found      = false;
            Int32      Product_ID = 000001;

            Found = AProduct.Find(Product_ID);
            Assert.IsTrue(Found);
        }
예제 #3
0
        public void FindMethodOK()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();
            //create some test data to assign to the property
            Boolean Found = false;

            Int32 Product_ID = 1;

            Found = AProduct.Find(Product_ID);
            Assert.IsTrue(Found);
        }
 public void FindMethodOK()
 {
     //create instance for the class we want to create
     clsProduct AProduct = new clsProduct();
     //boolean variable to store the result of the validation
     Boolean Found = false;
     //create some test data to use with the method
     Int32 ProductID = 1;
     //invoke the method
     Found = AProduct.Find(ProductID);
     //test to see that the result is correct
     Assert.IsTrue(Found);
 }
        public void TestProductDescriptionFound()
        {
            clsProduct AProduct  = new clsProduct();
            Boolean    Found     = false;
            Boolean    OK        = true;
            Int32      ProductNo = 32;

            Found = AProduct.Find(ProductNo);
            if (AProduct.ProductDescription != "Retro games console")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
        public void TestUnitPriceFound()
        {
            clsProduct AProduct  = new clsProduct();
            Boolean    Found     = false;
            Boolean    OK        = true;
            Int32      ProductNo = 32;

            Found = AProduct.Find(ProductNo);
            if (AProduct.UnitPrice != 32.50)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
        public void TestInStockFound()
        {
            clsProduct AProduct  = new clsProduct();
            Boolean    Found     = false;
            Boolean    OK        = true;
            Int32      ProductNo = 32;

            Found = AProduct.Find(ProductNo);
            if (AProduct.InStock != true)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
        public void TestDiscountActiveFound()
        {
            clsProduct AProduct  = new clsProduct();
            Boolean    Found     = false;
            Boolean    OK        = true;
            Int32      ProductNo = 32;

            Found = AProduct.Find(ProductNo);
            if (AProduct.DiscountActive != true)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #9
0
        public void FindMethodOk()
        {
            //creates an instance of a class
            clsProduct AProduct = new clsProduct();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //create some data for testing with the method
            Int32 ProductID = 3;

            //invoke the method
            Found = AProduct.Find(ProductID);
            // test to see is the method correct
            Assert.IsTrue(Found);
        }
        public void TestProductNameFound()
        {
            clsProduct AProduct  = new clsProduct();
            Boolean    Found     = false;
            Boolean    OK        = true;
            Int32      ProductNo = 32;

            Found = AProduct.Find(ProductNo);
            if (AProduct.ProductName != "Sega Megadrive")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #11
0
    protected void Find_Click(object sender, EventArgs e)
    {
        clsProduct AProduct = new clsProduct();
        Int32      ProductNo;
        Boolean    Found = false;

        ProductNo = Convert.ToInt32(txtProductNo.Text);
        Found     = AProduct.Find(ProductNo);
        if (Found == true)
        {
            txtProductName.Text        = AProduct.ProductName;
            txtProductDescription.Text = AProduct.ProductDescription;
            txtUnitPrice.Text          = AProduct.UnitPrice.ToString();
            txtStockAmount.Text        = AProduct.StockAmount.ToString();
        }
    }
예제 #12
0
        public void TestNext_DeliveryFound()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();

            Boolean Found = false;
            Boolean OK    = true;

            Int32 Product_ID = 1;

            Found = AProduct.Find(Product_ID);

            if (AProduct.Next_Delivery != Convert.ToDateTime("27/02/2021"))
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
예제 #13
0
        public void TestIs_AvailableFound()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();

            Boolean Found = false;
            Boolean OK    = true;

            Int32 Product_ID = 1;

            Found = AProduct.Find(Product_ID);

            if (AProduct.Is_Available != true)
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
예제 #14
0
        public void TestProduct_IDFound()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();
            //create some test data to assign to the property
            Boolean Found = false;
            Boolean OK    = true;

            Int32 Product_ID = 1;

            Found = AProduct.Find(Product_ID);

            if (AProduct.Product_ID != 1)
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
예제 #15
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsProduct AProduct = new clsProduct();
        Int32      Product_ID;
        Boolean    Found = false;

        Product_ID = Convert.ToInt32(txtProductID.Text);
        Found      = AProduct.Find(Product_ID);
        if (Found == true)
        {
            txtTitle.Text        = AProduct.Title;
            txtDescription.Text  = AProduct.Description;
            txtUnitPrice.Text    = AProduct.Unit_Price.ToString();
            txtReleaseDate.Text  = AProduct.Release_Date.ToString();
            txtGenre.Text        = AProduct.Genre.ToString();
            txtPlatform.Text     = AProduct.Platform.ToString();
            txtOut_Of_Stock.Text = AProduct.Out_Of_Stock.ToString();
        }
    }
예제 #16
0
        public void TestColourFound()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();

            Boolean Found = false;
            Boolean OK    = true;

            Int32 Product_ID = 1;

            Found = AProduct.Find(Product_ID);

            if (AProduct.Colour != "Yellow")
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
 public void TestProductPriceFound()
 {
     //create an instance of the class we want to create
     clsProduct AProduct = new clsProduct();
     //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 it with the method
     Int32 ProductID = 3;
     //invoke the method 
     Found = AProduct.Find(ProductID);
     //check the property 
     if (AProduct.ProductPrice != 650.0000m)
     {
         OK = false;
     }
     //test to see that the result is correct
     Assert.IsTrue(OK);
 }
예제 #18
0
        public void TestProductNotFound()
        {
            //create instance of the class to be created
            clsProduct AProduct = new clsProduct();
            //boolean var to store the result of the search
            Boolean Found = false;
            //boolean var to record if the data is OK
            Boolean OK = true;
            //create some test data to use with the method
            Int32 Product_ID = 000001;

            //invoke the method
            Found = AProduct.Find(Product_ID);
            //check product ID
            if (AProduct.Product_ID != 000001)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #19
0
        public void TestProductNoFound()
        {
            //create an instance of the class we want to create
            clsProduct AnProduct = new clsProduct();
            //boolean variable to store the result of the search
            Boolean Found = false;
            //boolean variable to store the result of the search
            Boolean OK = true;
            //create some test data to use with the method
            Int32 ProductNo = 1;

            //invoke the method
            Found = AnProduct.Find(ProductNo);
            //check the staff No
            if (AnProduct.ProductNo != 1)
            {
                OK = false;
            }
            //test the result is correct
            Assert.IsTrue(OK);
        }
예제 #20
0
        public void TestProductIDFound()
        {
            //creates an instance of a class
            clsProduct AProduct = new clsProduct();
            //boolean variable to store the result of the validation
            Boolean Found = false;
            //boolean variable to record the data is ok
            Boolean Ok = true;
            //create some data for testing with the method
            Int32 ProductID = 3;

            //invoke the method
            Found = AProduct.Find(ProductID);
            // check the product id

            if (AProduct.ProductID != 3)
            {
                Ok = false;
            }
            Assert.IsTrue(Ok);
        }
예제 #21
0
        public void TestReleaseDateFound()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();
            //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 Product_ID = 000001;

            //invoke the method
            Found = AProduct.Find(Product_ID);
            //check the property
            if (AProduct.Release_Date != Convert.ToDateTime("08/11/2019"))
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #22
0
        public void TestDescriptionFound()
        {
            //create an instance of the class we want to create
            clsProduct AProduct = new clsProduct();
            //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 Product_ID = 000001;

            //invoke the method
            Found = AProduct.Find(Product_ID);
            //check the property
            if (AProduct.Description != "Death Stranding is an action game set in an open world, and also includes asynchronous online functions.")
            {
                OK = false;
            }
            //test to see that the result is correct
            Assert.IsTrue(OK);
        }
예제 #23
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create an instance of the product class
        clsProduct AProduct = new clsProduct();
        //variable to store the primary key
        Int32 ProductID;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        ProductID = Convert.ToInt32(txtID.Text);
        //find the record
        Found = AProduct.Find(ProductID);
        //if found
        if (Found == true)
        {
            //display the values of the product in the form
            txtName.Text        = AProduct.Name;
            txtPrice.Text       = AProduct.Price;
            txtDescription.Text = AProduct.Description;
        }
    }
예제 #24
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsProduct AProduct = new clsProduct();

        Int32 Product_ID;

        Boolean Found = false;

        Product_ID = Convert.ToInt32(TxtID.Text);

        Found = AProduct.Find(Product_ID);

        if (Found == true)
        {
            TxtName.Text          = AProduct.Name;
            TxtType.Text          = AProduct.Type;
            TxtColour.Text        = AProduct.Colour;
            TxtCost.Text          = AProduct.Cost.ToString();
            TxtStock_Count.Text   = AProduct.Stock_Count.ToString();
            ChkAvailable.Checked  = AProduct.Is_Available;
            TxtNext_Delivery.Text = AProduct.Next_Delivery.ToString();
        }
    }