Example #1
0
 public static void Main()
 {
     var source = new Account<List<LedgerEntry>>(new List<LedgerEntry> { new LedgerEntry("start", 0m), new LedgerEntry("first deposit", 1000m) });
     var destination = new Account<List<LedgerEntry>>(new List<LedgerEntry>());
     var context = new MoneyTransfer<List<LedgerEntry>,List<LedgerEntry>>(source, destination, 245m);
     context.Trans();
     Console.WriteLine("Press enter...");
     Console.ReadLine();
 }
Example #2
0
 public static void Main()
 {
     try
     {
         System.Diagnostics.Debugger.Launch();
         var list = new List<LedgerEntry>();
         list.Add(new LedgerEntry("start", 0m));
         list.Add(new LedgerEntry("first deposit", 1000m));
         var source = new Account<List<LedgerEntry>>(list);
         var destination = new Account<List<LedgerEntry>>(new List<LedgerEntry>());
         var context = new MoneyTransfer<Account<List<LedgerEntry>>, Account<List<LedgerEntry>>>(source, destination, 245m);
         context.Transfer();
     }
     catch (Exception e)
     {
         Console.WriteLine("Error: " + e.ToString());
     }
 }
Example #3
0
 public MoneyTransfer(Account source, Account destination, decimal amount)
 {
     role____Source= source;
     role____Destination= destination;
     role____Amount= amount;
 }