예제 #1
0
        public void TestDeliveryDateFound()
        {
            clsSupply Supplier = new clsSupply();

            Boolean Found = false;

            Boolean OK = true;

            Int32 ProductID = 2;

            Found = Supplier.Find(ProductID);

            if (Supplier.DeliveryDate != Convert.ToDateTime("15/04/2021"))
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #2
0
        public void InStockFound()
        {
            clsSupply Supplier = new clsSupply();
            Boolean   Found    = false;

            Boolean OK = true;

            Int32 ProductID = 2;

            Found = Supplier.Find(ProductID);

            if (Supplier.InStock != true)
            {
                OK = false;
            }

            Assert.IsTrue(OK);
        }
예제 #3
0
        public void TestQuantityFound()
        {
            clsSupply Supplier = new clsSupply();
            Boolean   Found    = false;

            Boolean OKs = true;



            Int32 ProductID = 2;

            Found = Supplier.Find(ProductID);

            if (Supplier.Quantity != 3213)
            {
                OKs = false;
            }
            Assert.IsTrue(OKs);
        }
예제 #4
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsSupply Supplier = new clsSupply();
        Int32     ProductID;

        Boolean Found = false;

        ProductID = Convert.ToInt32(txtProductID.Text);

        Found = Supplier.Find(ProductID);

        if (Found == true)
        {
            txtName.Text         = Supplier.Name.ToString();
            txtDeliveryDate.Text = Supplier.DeliveryDate.ToString();
            txtPrice.Text        = Supplier.Price.ToString();
            txtQuantity.Text     = Supplier.Quantity.ToString();
            chkInStock.Checked   = Supplier.InStock;
        }
    }