public void CardHolderNameMidOK() { //Create an instance of the clsSTPayment clsSTPayment STPayment = new clsSTPayment(); //String a variable to store my error message string Error = ""; //Create some test data to pass to the method string CardHolderName = "ABCDEFGHIJKLMNOPQRST"; //Invoke the method Error = STPayment.Valid(CardNumber, AccountNumber, SortCode, ExpiryDate, ValidFrom, CardHolderName, CVC); //Test to see that the result is correct Assert.AreEqual(Error, ""); }
public void FindMethodOK() { //Create an instance of the clsSTPayment clsSTPayment STPayment = new clsSTPayment(); //Boolean variable to store the result of the validation Boolean Found = false; //Create some test data to use with the method Int32 PaymentID = 1; //Invoke the method Found = STPayment.Find(PaymentID); //Test to see that the result is correct Assert.IsTrue(Found); }
public void ThisPaymentPropertyOK() { //Create an instance of the class we want to create clsSTPaymentCollection AllTestPayments = new clsSTPaymentCollection(); //Create some test data to assign to the property //in this case the data needs to be a list of objects clsSTPayment PaymentTest = new clsSTPayment(); //Set it properties PaymentTest.CardNumber = "1234567891234567"; PaymentTest.AccountNumber = "12345678"; PaymentTest.SortCode = "123456"; PaymentTest.ExpiryDate = "12/22"; PaymentTest.ValidFrom = "12/19"; PaymentTest.CardHolderName = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM"; PaymentTest.CVC = "123"; //Assign the data to the property AllTestPayments.ThisPayment = PaymentTest; //Test to see that the two values are the same Assert.AreEqual(AllTestPayments.ThisPayment, PaymentTest); }
public void CVCFound() { //Create an instance of the clsSTPayment clsSTPayment STPayment = new clsSTPayment(); //Boolean variable to store the result of the search Boolean Found = false; //Boolean variable to recrd if the data is ok (assume it is) Boolean OK = true; //Create some test data to use with the method Int32 PaymentID = 1; //Invoke the method Found = STPayment.Find(PaymentID); //Check the property if (STPayment.CVC != "123") { OK = false; } //Test to see that the result is correct Assert.IsTrue(OK); }
public void UpdatePaymentMethodOK() { //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 payment record PrimaryKey = AllPayments.Add(); //Set the primary key of the test data PaymentTestItem.PaymentID = PrimaryKey; //Modify the test data PaymentTestItem.CardNumber = "1234567891234568"; PaymentTestItem.AccountNumber = "12345679"; PaymentTestItem.SortCode = "123457"; PaymentTestItem.ExpiryDate = "12/23"; PaymentTestItem.ValidFrom = "12/20"; PaymentTestItem.CardHolderName = "I HATE PROJECT MANAGEMENT"; PaymentTestItem.CVC = "124"; //Set the record based on the new test data AllPayments.ThisPayment = PaymentTestItem; //Update the record AllPayments.Update(); //Find the record AllPayments.ThisPayment.Find(PrimaryKey); //test to see that the two values are the same Assert.AreEqual(AllPayments.ThisPayment, PaymentTestItem); }