예제 #1
0
 public void TestToStringCheque() 
 {
     Cheque cq1 = new Cheque("ABC", "AAA", 15645131);
     PaymentCheque pay1 = new PaymentCheque(cq1, 20.5, 1576);
     Assert.AreEqual("Payment: Cheque\nCheque Book Name: ABC\nBank: AAA\nAccount Number: 15645131\nAmount: 20,5\nCheque Number: 1576", pay1.ToString());
 
 }
예제 #2
0
 public void TestToString()
 {
     Cheque cq1 = new Cheque("ABC", "AAA", 15645131);
     Cheque cq2 = new Cheque("ASW", "ASD", 156465);
     
     Assert.AreEqual("Cheque\nCheque Book Name: ABC\nBank: AAA\nAccount Number: 15645131", cq1.ToString());
     Assert.AreEqual("Cheque\nCheque Book Name: ASW\nBank: ASD\nAccount Number: 156465", cq2.ToString());
 }
        /// <summary>
        /// The controller method to create the cheque book
        /// </summary>
        /// <param name="chequeBook">the cheque book name</param>
        /// <param name="bank">the cheque book bank</param>
        /// <param name="accountNumber">the account number of the cheque book</param>
        public void CreateCheque(string chequeBook, string bank, int accountNumber)
        {
            Cheque cc = new Cheque(chequeBook, bank, accountNumber);

            PersistenceFactory.GetFactory().GetRepository().GetPaymentMethodRepository().Save(cc);
        }