示例#1
0
        public void DeletePaymentMethodOK()
        {
            //Create an instance of the class we want to create
            clsSTPaymentCollection AllPayments = new clsSTPaymentCollection();
            //Create an item of test data
            clsSTPayment PaymentTestItem = new clsSTPayment();
            //Var to store the primary key
            Int32 PrimaryKey = 0;

            //Set its properties
            PaymentTestItem.CardNumber     = "1234567891234567";
            PaymentTestItem.AccountNumber  = "12345678";
            PaymentTestItem.SortCode       = "123456";
            PaymentTestItem.ExpiryDate     = "12/22";
            PaymentTestItem.ValidFrom      = "12/19";
            PaymentTestItem.CardHolderName = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM";
            PaymentTestItem.CVC            = "123";
            //Set this ThisPayment to the test data
            AllPayments.ThisPayment = PaymentTestItem;
            //Add the record
            PrimaryKey = AllPayments.Add();
            //Set the primary key of the test data
            PaymentTestItem.PaymentID = PrimaryKey;
            //search the payment record
            AllPayments.ThisPayment.Find(PrimaryKey);
            //Delete the record
            AllPayments.Delete();
            //Now found the payment record
            Boolean Found = AllPayments.ThisPayment.Find(PrimaryKey);

            //test to see that the two values are the same
            Assert.IsFalse(Found);
        }
示例#2
0
        void DeletePayments()
        {
            //Create a new instance of the payment book
            clsSTPaymentCollection PaymentBook = new clsSTPaymentCollection();

            //Find the record to delete
            PaymentBook.ThisPayment.Find(PaymentID);
            //Delete the record
            PaymentBook.Delete();
        }