public void DeleteMethodOK()
        {
            //create an instance of clsStockCollection
            clsStockCollection AllStock = new clsStockCollection();
            //create item of test data
            clsStock TestItem = new clsStock();
            //store primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.ItemId        = 1;
            TestItem.ItemName      = "Keycap";
            TestItem.Price         = 12.75m;
            TestItem.Material      = "Metal";
            TestItem.LastPurchased = DateTime.Now.Date;
            TestItem.Quantity      = 15;
            TestItem.InStock       = true;
            //set ThisItem to test data
            AllStock.ThisItem = TestItem;
            //add record
            PrimaryKey = AllStock.Add();
            //set primary key of test data
            TestItem.ItemId = PrimaryKey;
            //find record
            AllStock.ThisItem.Find(PrimaryKey);
            //delete record
            AllStock.Delete();
            //find record now
            Boolean Found = AllStock.ThisItem.Find(PrimaryKey);

            //test to see record was not found
            Assert.IsFalse(Found);
        }
        public void AddDeleteOK()
        {
            //create instance of the collection
            clsStockCollection AllStock = new clsStockCollection();
            //creating an item of test data
            clsStock TestItem   = new clsStock();
            Int32    PrimaryKey = 0;

            //Adding test data
            TestItem.Product_ID          = 2;
            TestItem.Product_Name        = "Protien Powder 2kg WHEY";
            TestItem.Product_Type        = "Protien powder";
            TestItem.Product_Description = "Each scoop contains 24grams of protien out of the total 31 grams. The protien is from a whey source (dairy).";
            TestItem.Quantity            = 250;
            TestItem.Price = 55;
            //set ThisStock to testitems
            AllStock.ThisStock = TestItem;
            //add the records
            PrimaryKey = AllStock.Add();
            //set the primary key of the test data
            TestItem.Product_ID = PrimaryKey;
            //find the recrods to verify it worked
            AllStock.ThisStock.Find(PrimaryKey);

            AllStock.Delete();

            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Example #3
0
        public void DeleteMethodOK()
        {
            //create an instance of the clsStockCollection class
            clsStockCollection AllStock = new clsStockCollection();
            //create the item of test data
            clsStock TestItem = new clsStock();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.InStock     = true;
            TestItem.StockID     = 11;
            TestItem.Price       = 79.99;
            TestItem.LastEdited  = DateTime.Now.Date;
            TestItem.Quantity    = 150;
            TestItem.Description = "ASROCK B450M PRO4-F MOTHERBOARD";
            //set ThisStock to the test data
            AllStock.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStock.Add();
            //set the primary key of the test data
            TestItem.StockID = PrimaryKey;
            //find the record
            AllStock.ThisStock.Find(PrimaryKey);
            //delete record
            AllStock.Delete();
            //now find the record
            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Example #4
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStockCollection AllStock = new clsStockCollection();
            //create the item of test data
            clsStock TestItem = new clsStock();
            //var to store the primary key. The instructions say to use int32 but I will use Double --------------------- I changed it back again.
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Active      = true;
            TestItem.Gender      = "Male";
            TestItem.Size        = "Small";
            TestItem.Description = "Socks";
            TestItem.Price       = 2.99;
            TestItem.InStock     = true;
            TestItem.DateArrived = DateTime.Now.Date;
            //set thisStock to the test data
            AllStock.ThisStock = TestItem;
            //Add the record
            AllStock.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStock.Delete();
            //now find the record
            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            //Test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            clsStockCollection AllStock = new clsStockCollection();
            clsStock           TestItem = new clsStock();
            Int32 PrimaryKey            = 0;

            TestItem.StockID          = 2;
            TestItem.ItemName         = "GTX 780";
            TestItem.StockDescription = "NVIDIA GPU";
            TestItem.StockLevel       = 1;
            TestItem.StockPrice       = 150;

            AllStock.ThisStock = TestItem;

            PrimaryKey = AllStock.Add();

            TestItem.StockID = PrimaryKey;

            AllStock.ThisStock.Find(PrimaryKey);

            AllStock.Delete();

            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Example #6
0
        public void DeleteMethodOK()
        {
            //create an instance of the class I want to create
            clsStockCollection AllStocks = new clsStockCollection();
            //create test data
            clsStock TestItem = new clsStock();
            //variable to store the primary key
            Int32 PrimaryKey = 0;

            //set the properties
            TestItem.StockID        = 1;
            TestItem.Name           = "Example";
            TestItem.Description    = "Some item info";
            TestItem.StockQuantity  = 1;
            TestItem.StockItemPrice = 1;
            //set ThisStock to the test data
            AllStocks.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStocks.Add();
            //set the primary of the test data
            TestItem.StockID = PrimaryKey;
            //find the record
            AllStocks.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStocks.Delete();
            //now find the record
            Boolean Found = AllStocks.ThisStock.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Example #7
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStockCollection AllStock = new clsStockCollection();
            //create the item of test data
            ClsStock TestItem = new ClsStock();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.InStck          = true;
            TestItem.ProductNo       = 1;
            TestItem.ProductDescript = "Liverpool Shirt";
            TestItem.Cost            = 59;
            TestItem.StockNo         = 50;
            TestItem.DateAdded       = DateTime.Now.Date;
            //set ThisStock to the test data
            AllStock.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStock.Add();
            //set the primary key of the test data
            TestItem.StockNo = PrimaryKey;
            //find the record
            AllStock.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStock.Delete();
            //now find the record
            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
        public void DeleteMethodOk()
        {
            clsStockCollection StockCollection = new clsStockCollection();

            clsStock TestGame = new clsStock();

            Int32 PrimaryKey = 0;

            TestGame.GameTitle     = "Ratchet & Clank";
            TestGame.Platform      = "Playstation 2";
            TestGame.Price         = 25;
            TestGame.ReleaseDate   = DateTime.Now.Date;
            TestGame.InStock       = true;
            TestGame.StockQuantity = 8;

            StockCollection.ThisGame = TestGame;

            PrimaryKey = StockCollection.Add();

            TestGame.productId = PrimaryKey;

            StockCollection.ThisGame.Find(PrimaryKey);

            StockCollection.Delete();

            Boolean Found = StockCollection.ThisGame.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
        public void DeleteMethodOK()
        {
            clsStockCollection allStock = new clsStockCollection();

            clsStock testItem = new clsStock();

            Int32 PrimaryKey = 0;

            testItem.StockAvailability = 10;
            testItem.StockDescription  = "Comic Book";
            testItem.StockPrice        = 9.99;
            testItem.IsBeingRestocked  = true;

            allStock.ThisStock = testItem;

            PrimaryKey = allStock.Add();

            testItem.StockID = PrimaryKey;

            allStock.ThisStock.Find(PrimaryKey);

            allStock.Delete();

            Boolean Found = allStock.ThisStock.Find(PrimaryKey);

            Assert.AreEqual(allStock.ThisStock, testItem);
        }
Example #10
0
        public void DeleteMethodOK()
        {
            //create an instance of the class
            clsStockCollection AllStock = new clsStockCollection();
            //create the item of test data
            clsStock TestItem = new clsStock();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set the properties
            TestItem.Available   = true;
            TestItem.BookId      = 1;
            TestItem.DateAdded   = DateTime.Now.Date;
            TestItem.Description = "Mr and Mrs Twit, Roald Dahl";
            TestItem.Price       = 8.99;
            TestItem.Quantity    = 30;
            //set this stock to the test data
            AllStock.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStock.Add();
            //set the primary key of the test data
            TestItem.BookId = PrimaryKey;
            //find the record
            AllStock.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStock.Delete();
            //now find the record
            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Example #11
0
        public void UpdateMethodOkay()
        {
            clsStockCollection allStock = new clsStockCollection();
            clsStock           aBook    = new clsStock();
            int PrimaryKey = 0;

            aBook.ISBN         = "1444444444444";
            aBook.BookName     = "Testbook";
            aBook.Author       = "Terry Pratchett";
            aBook.OnOrder      = false;
            aBook.StockLevel   = 100;
            aBook.Price        = 9.99;
            aBook.SupplierID   = 1;
            aBook.ReleaseDate  = Convert.ToDateTime("25/9/2004");
            allStock.ThisStock = aBook;
            PrimaryKey         = allStock.Add();
            aBook.ISBN         = "1555555555555";
            aBook.BookName     = "Feet of Clay";
            aBook.Author       = "Berry Pratchett";
            aBook.OnOrder      = true;
            aBook.StockLevel   = 101;
            aBook.Price        = 9.98;
            aBook.SupplierID   = 2;
            aBook.ReleaseDate  = Convert.ToDateTime("26/9/2004");
            allStock.ThisStock = aBook;
            allStock.Update();
            allStock.ThisStock.Find(PrimaryKey);
            Assert.AreEqual(allStock.ThisStock, aBook);
            //prevents the data being left in the table and failing future tests due to unique isbn constraint
            allStock.Delete();
        }
Example #12
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStockCollection AllStock = new clsStockCollection();
            //create the item of test data
            clsStock TestItem = new clsStock();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //Set its properties
            TestItem.Available        = true;
            TestItem.StockID          = 1;
            TestItem.StockDescription = "Converse";
            TestItem.StockColour      = "Red";
            TestItem.StockAmount      = 300;
            TestItem.StockPrice       = 20.00M;
            TestItem.DateOrdered      = DateTime.Now.Date;
            //set this stock to the test data
            AllStock.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStock.Add();
            //set the primary key of the test data
            TestItem.StockID = PrimaryKey;
            //find the record
            AllStock.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStock.Delete();
            //now find the record
            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
Example #13
0
        public void DeleteMethodOK()
        {
            clsStockCollection AllProducts = new clsStockCollection();
            clsStock           TestProduct = new clsStock();
            int PrimaryKey = 0;

            TestProduct.ProductId          = 1;
            TestProduct.ProductName        = "game 2";
            TestProduct.ReleaseDate        = DateTime.Now.Date;
            TestProduct.Price              = Convert.ToDecimal(4.20);
            TestProduct.InStock            = false;
            TestProduct.ProductDescription = "yet another game";

            AllProducts.ThisProduct = TestProduct;
            PrimaryKey = AllProducts.Add();

            TestProduct.ProductId = PrimaryKey;

            AllProducts.ThisProduct.Find(PrimaryKey);
            AllProducts.Delete();

            Boolean Found = AllProducts.ThisProduct.Find(PrimaryKey);

            Assert.IsFalse(Found);
        }
Example #14
0
        public void DeleteMethodOK()
        {
            //create an instance of the class we want to create
            clsStockCollection AllStocks = new clsStockCollection();
            //create the item of the test data
            clsStock TestItem = new clsStock();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set its properties
            TestItem.Availability = true;
            TestItem.CarModel     = "Mercedes A Class Test ADD function";
            TestItem.BHP          = "420 BHP";
            TestItem.Price        = 1;
            TestItem.DateAdded    = DateTime.Now.Date;
            //set this address to the test data
            AllStocks.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStocks.Add();
            //set the pimrary key of the test date
            TestItem.ModelNo = PrimaryKey;
            //find the record
            AllStocks.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStocks.Delete();
            //now find the record
            Boolean Found = AllStocks.ThisStock.Find(PrimaryKey);

            //test to see that te record was not found
            Assert.IsFalse(Found);
        }
Example #15
0
    void DeleteStock()
    {
        clsStockCollection StockBook = new clsStockCollection();

        StockBook.ThisStock.Find(StockID);
        StockBook.Delete();
    }
        public void DeleteMethodOK()
        {
            clsStockCollection AllStock = new clsStockCollection();

            clsStock TestItem = new clsStock();

            Int32 PrimaryKey = 0;

            TestItem.Clearence = true;
            TestItem.Description = "AddMethodExample";
            TestItem.Price = 9999.99;
            TestItem.Pristine = 12;
            TestItem.Non_Pristine = 15;
            TestItem.Next_Intake = DateTime.Now.Date;

            AllStock.ThisStock = TestItem;

            PrimaryKey = AllStock.Add();

            TestItem.Product_Code = PrimaryKey;

            AllStock.ThisStock.Find(PrimaryKey);

            AllStock.Delete();

            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            Assert.IsFalse(Found);

        }
Example #17
0
        public void DeleteMethodOK()
        {
            //create an instance of the class I want to create
            clsStockCollection AllStock = new clsStockCollection();
            //create the item of test data
            clsStock TestItem = new clsStock();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //seet it's properties
            TestItem.InStock          = true;
            TestItem.StockNo          = 2;
            TestItem.DateAdded        = DateTime.Now.Date;
            TestItem.StockDescription = "Part";
            TestItem.StockLocation    = "Warehouse";
            //set ThisStock to the test data
            AllStock.ThisStock = TestItem;
            //add the record
            PrimaryKey = AllStock.Add();
            //set the primaryKey of the test data
            TestItem.StockNo = PrimaryKey;
            //find the record
            AllStock.ThisStock.Find(PrimaryKey);
            //delete the record
            AllStock.Delete();
            //now find the record
            Boolean Found = AllStock.ThisStock.Find(PrimaryKey);

            //test to see that the record was not found
            Assert.IsFalse(Found);
        }
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsStockCollection Products = new clsStockCollection();

        Products.ThisProduct.Find(ProductId);
        Products.Delete();
        Response.Redirect("ProductList.aspx");
    }
Example #19
0
    protected void yesButton_Click(object sender, EventArgs e)
    {
        clsStockCollection stockList = new clsStockCollection();

        stockList.thisStock.Find(numberPlate);
        stockList.Delete();
        Response.Redirect("stockList.aspx");
    }
Example #20
0
    void DeleteAddress()
    {
        //create a new instance of stock
        clsStockCollection stock = new clsStockCollection();

        stock.ThisStock.Find(StockNo);
        stock.Delete();
    }
Example #21
0
    protected void Button2_Click(object sender, EventArgs e)
    {
        clsStockCollection Stocks = new clsStockCollection();

        Stocks.ThisStock.Find(ClothesNo);
        Stocks.Delete();
        Response.Redirect("StockList.aspx");
    }
Example #22
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        clsStockCollection StockBook = new clsStockCollection();

        StockBook.ThisStock.Find(Product_ID);
        StockBook.Delete();
        Response.Redirect("StockList.aspx");
    }
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsStockCollection AddressBook = new clsStockCollection();

        AddressBook.ThisStock.Find(PartNo);
        AddressBook.Delete();
        Response.Redirect("DefaultStock.aspx");
    }
Example #24
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsStockCollection StockList = new clsStockCollection();

        StockList.ThisStock.Find(ProductID);
        StockList.Delete();
        Response.Redirect("StockList.aspx");
    }
    protected void btnYes_Click(Object sender, EventArgs e)
    {
        clsStockCollection StockCollection = new clsStockCollection();

        StockCollection.ThisGame.Find(productId);
        StockCollection.Delete();
        Response.Redirect("StockList.aspx");
    }
Example #26
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        clsStockCollection stockCollection = new clsStockCollection();

        stockCollection.ThisStock.Find(BookID);
        stockCollection.Delete();
        Response.Redirect("StockList.aspx");
    }
Example #27
0
    //function to delete the selected item
    void DeleteStock()
    {
        //create a new instance of the order
        clsStockCollection StockBook = new clsStockCollection();

        //find the record to delete
        StockBook.ThisStock.Find(StockID);
        //delete the record
        StockBook.Delete();
    }
Example #28
0
    protected void btnYes_Click(object sender, EventArgs e)
    {
        //create new instance of stock collection
        clsStockCollection StockBook = new clsStockCollection();

        StockBook.ThisStock.Find(gameID);
        //invoke the delete method
        StockBook.Delete();
        //redirect user to stocklist
        Response.Redirect("StockList.aspx");
    }
Example #29
0
    void DeleteStocks()
    {
        //function to delete the selected record

        clsStockCollection StockBook = new clsStockCollection();

        //find the record to delete
        StockBook.ThisStock.Find(ModelNo);
        //delete the record
        StockBook.Delete();
    }
    protected void btnYes_Click1(object sender, EventArgs e)
    {
        clsStockCollection Stock = new clsStockCollection();

        //find the record table
        Stock.ThisStock.Find(BookId);
        //delete the record
        Stock.Delete();
        //redirect back to the amin page
        Response.Redirect("StockList.aspx");
    }