public void DeleteMethodOK()
        {
            //create the instance of the class we want to create
            clsPaymentCollection AllPayments = new clsPaymentCollection();
            //create some test data to assign to the property
            clsPayment TestItem = new clsPayment();
            //var to store the primary key
            Int32 PrimaryKey = 0;

            //set the properties of the test object
            TestItem.PaymentId     = 7;
            TestItem.PayeeName     = "Samsung OLED TV";
            TestItem.Amount        = 3999.99m;
            TestItem.CardNumber    = "111111111111111";
            TestItem.Method        = "Debit";
            TestItem.DatePurchased = DateTime.Now.Date;
            TestItem.Email         = "*****@*****.**";
            //set ThisPayment to the test data
            AllPayments.ThisPayment = TestItem;
            //add the record
            PrimaryKey = AllPayments.Add();
            //set the primary key to the test data
            TestItem.PaymentId = PrimaryKey;
            //find the record
            AllPayments.ThisPayment.Find(PrimaryKey);
            //delete the record
            AllPayments.Delete();
            //now find the record
            Boolean Found = AllPayments.ThisPayment.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
Beispiel #2
0
        void DeleteInventory()
        {
            //function to delete the selected record

            //create an instance of the Inventory List
            clsPaymentCollection AllPayments = new clsPaymentCollection();

            //find the record to delete
            AllPayments.ThisPayment.Find(mPaymentId);
            //delete the record
            AllPayments.Delete();
        }