Bulgogi

Costa Rica

Mar 25th, 2021 (edited)
477
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. test('group should be able to minimize payments, Costa Rica', () {
  2.       final User jm = User('0', 'Justin Mott');
  3.       final Group costaRica = Group(jm, 'testing_group');
  4.       final User mh = User('1', 'Mohammad Haveliwala');
  5.       costaRica.addUser(mh);
  6.       final User se = User('2', 'Suhas Etigunta');
  7.       costaRica.addUser(se);
  8.       final User rm = User('3', 'Raj Malhotra');
  9.       costaRica.addUser(rm);
  10.  
  11.       // Alcohol
  12.       costaRica
  13.           .addPayment(ReceiptTransaction(jm, mh, 70 / 4, costaRica.groupName));
  14.       costaRica
  15.           .addPayment(ReceiptTransaction(jm, se, 70 / 4, costaRica.groupName));
  16.       costaRica
  17.           .addPayment(ReceiptTransaction(jm, rm, 70 / 4, costaRica.groupName));
  18.       // spill
  19.       costaRica
  20.           .addPayment(ReceiptTransaction(jm, mh, 24 / 2, costaRica.groupName));
  21.       // drinks 1st night
  22.       costaRica
  23.           .addPayment(ReceiptTransaction(jm, mh, 35 / 2, costaRica.groupName));
  24.       costaRica
  25.           .addPayment(ReceiptTransaction(jm, mh, 32 / 3, costaRica.groupName));
  26.       costaRica
  27.           .addPayment(ReceiptTransaction(jm, rm, 32 / 3, costaRica.groupName));
  28.       // dinner first night
  29.       costaRica.addPayment(
  30.           ReceiptTransaction(jm, mh, 58.03 / 4, costaRica.groupName));
  31.       costaRica.addPayment(
  32.           ReceiptTransaction(jm, se, 58.03 / 4, costaRica.groupName));
  33.       costaRica.addPayment(
  34.           ReceiptTransaction(jm, rm, 58.03 / 4, costaRica.groupName));
  35.       // drinks + snacks
  36.       costaRica.addPayment(
  37.           ReceiptTransaction(jm, mh, 65.28 / 4, costaRica.groupName));
  38.       costaRica.addPayment(
  39.           ReceiptTransaction(jm, se, 65.28 / 4, costaRica.groupName));
  40.       costaRica.addPayment(
  41.           ReceiptTransaction(jm, rm, 65.28 / 4, costaRica.groupName));
  42.       // mistico park
  43.       costaRica
  44.           .addPayment(ReceiptTransaction(jm, mh, 104 / 4, costaRica.groupName));
  45.       costaRica
  46.           .addPayment(ReceiptTransaction(jm, se, 104 / 4, costaRica.groupName));
  47.       costaRica
  48.           .addPayment(ReceiptTransaction(jm, rm, 104 / 4, costaRica.groupName));
  49.       // mistico tour guide
  50.       costaRica
  51.           .addPayment(ReceiptTransaction(se, mh, 80 / 4, costaRica.groupName));
  52.       costaRica
  53.           .addPayment(ReceiptTransaction(se, jm, 80 / 4, costaRica.groupName));
  54.       costaRica
  55.           .addPayment(ReceiptTransaction(se, rm, 80 / 4, costaRica.groupName));
  56.       // surfing
  57.       costaRica
  58.           .addPayment(ReceiptTransaction(se, mh, 40 / 4, costaRica.groupName));
  59.       costaRica
  60.           .addPayment(ReceiptTransaction(se, jm, 40 / 4, costaRica.groupName));
  61.       costaRica
  62.           .addPayment(ReceiptTransaction(se, rm, 40 / 4, costaRica.groupName));
  63.       // gas x3
  64.       costaRica.addPayment(
  65.           ReceiptTransaction(jm, mh, 99.33 / 4, costaRica.groupName));
  66.       costaRica.addPayment(
  67.           ReceiptTransaction(jm, se, 99.33 / 4, costaRica.groupName));
  68.       costaRica.addPayment(
  69.           ReceiptTransaction(jm, rm, 99.33 / 4, costaRica.groupName));
  70.       // dinner cloud rainforest
  71.       costaRica.addPayment(
  72.           ReceiptTransaction(jm, mh, 39.56 / 4, costaRica.groupName));
  73.       costaRica.addPayment(
  74.           ReceiptTransaction(jm, se, 39.56 / 4, costaRica.groupName));
  75.       costaRica.addPayment(
  76.           ReceiptTransaction(jm, rm, 39.56 / 4, costaRica.groupName));
  77.       // cloud rainforest
  78.       costaRica.addPayment(
  79.           ReceiptTransaction(jm, mh, 44.99 / 4, costaRica.groupName));
  80.       costaRica.addPayment(
  81.           ReceiptTransaction(jm, se, 44.99 / 4, costaRica.groupName));
  82.       costaRica.addPayment(
  83.           ReceiptTransaction(jm, rm, 44.99 / 4, costaRica.groupName));
  84.       // Sol Del Carib x3
  85.       costaRica.addPayment(
  86.           ReceiptTransaction(jm, mh, 133.74 / 4, costaRica.groupName));
  87.       costaRica.addPayment(
  88.           ReceiptTransaction(jm, se, 133.74 / 4, costaRica.groupName));
  89.       costaRica.addPayment(
  90.           ReceiptTransaction(jm, rm, 133.74 / 4, costaRica.groupName));
  91.       // Minisuper La Lico N2
  92.       costaRica.addPayment(
  93.           ReceiptTransaction(jm, mh, 41.5 / 4, costaRica.groupName));
  94.       costaRica.addPayment(
  95.           ReceiptTransaction(jm, se, 41.5 / 4, costaRica.groupName));
  96.       costaRica.addPayment(
  97.           ReceiptTransaction(jm, rm, 41.5 / 4, costaRica.groupName));
  98.       // Johnny's
  99.       costaRica.addPayment(
  100.           ReceiptTransaction(jm, mh, 27.17 / 3, costaRica.groupName));
  101.       costaRica.addPayment(
  102.           ReceiptTransaction(jm, se, 27.17 / 3, costaRica.groupName));
  103.       // Beer at Sol Del Carib
  104.       costaRica
  105.           .addPayment(ReceiptTransaction(jm, mh, 3.62, costaRica.groupName));
  106.       // Mcdonalds
  107.       costaRica
  108.           .addPayment(ReceiptTransaction(jm, mh, 6.88, costaRica.groupName));
  109.       // Car insurance
  110.       costaRica
  111.           .addPayment(ReceiptTransaction(se, mh, 316 / 4, costaRica.groupName));
  112.       costaRica
  113.           .addPayment(ReceiptTransaction(se, jm, 316 / 4, costaRica.groupName));
  114.       costaRica
  115.           .addPayment(ReceiptTransaction(se, rm, 316 / 4, costaRica.groupName));
  116.       // food for hike
  117.       costaRica
  118.           .addPayment(ReceiptTransaction(se, mh, 20 / 4, costaRica.groupName));
  119.       costaRica
  120.           .addPayment(ReceiptTransaction(se, jm, 20 / 4, costaRica.groupName));
  121.       costaRica
  122.           .addPayment(ReceiptTransaction(se, rm, 20 / 4, costaRica.groupName));
  123.       costaRica
  124.           .addPayment(ReceiptTransaction(rm, mh, 20 / 4, costaRica.groupName));
  125.       costaRica
  126.           .addPayment(ReceiptTransaction(rm, se, 20 / 4, costaRica.groupName));
  127.       costaRica
  128.           .addPayment(ReceiptTransaction(rm, jm, 20 / 4, costaRica.groupName));
  129.       // coke
  130.       costaRica
  131.           .addPayment(ReceiptTransaction(rm, mh, 4 / 4, costaRica.groupName));
  132.       costaRica
  133.           .addPayment(ReceiptTransaction(rm, se, 4 / 4, costaRica.groupName));
  134.       costaRica
  135.           .addPayment(ReceiptTransaction(rm, jm, 4 / 4, costaRica.groupName));
  136.       // hike
  137.       costaRica
  138.           .addPayment(ReceiptTransaction(se, mh, 48 / 4, costaRica.groupName));
  139.       costaRica
  140.           .addPayment(ReceiptTransaction(se, jm, 48 / 4, costaRica.groupName));
  141.       costaRica
  142.           .addPayment(ReceiptTransaction(se, rm, 48 / 4, costaRica.groupName));
  143.       // Koki
  144.       costaRica
  145.           .addPayment(ReceiptTransaction(mh, jm, 200 / 4, costaRica.groupName));
  146.       costaRica
  147.           .addPayment(ReceiptTransaction(mh, se, 200 / 4, costaRica.groupName));
  148.       costaRica
  149.           .addPayment(ReceiptTransaction(mh, rm, 200 / 4, costaRica.groupName));
  150.       // La Fortuna Soda
  151.       costaRica
  152.           .addPayment(ReceiptTransaction(mh, jm, 41 / 4, costaRica.groupName));
  153.       costaRica
  154.           .addPayment(ReceiptTransaction(mh, se, 41 / 4, costaRica.groupName));
  155.       costaRica
  156.           .addPayment(ReceiptTransaction(mh, rm, 41 / 4, costaRica.groupName));
  157.       // 42nd St Bar
  158.       costaRica.addPayment(
  159.           ReceiptTransaction(jm, mh, 44.88 / 2, costaRica.groupName));
  160.       // Rafting
  161.       costaRica
  162.           .addPayment(ReceiptTransaction(rm, mh, 415 / 4, costaRica.groupName));
  163.       costaRica
  164.           .addPayment(ReceiptTransaction(rm, se, 415 / 4, costaRica.groupName));
  165.       costaRica
  166.           .addPayment(ReceiptTransaction(rm, jm, 415 / 4, costaRica.groupName));
  167.       // Chocolate Tour
  168.       costaRica
  169.           .addPayment(ReceiptTransaction(jm, mh, 100 / 4, costaRica.groupName));
  170.       costaRica
  171.           .addPayment(ReceiptTransaction(jm, se, 100 / 4, costaRica.groupName));
  172.       costaRica
  173.           .addPayment(ReceiptTransaction(jm, rm, 200 / 4, costaRica.groupName));
  174.       // Lost 100
  175.       costaRica
  176.           .addPayment(ReceiptTransaction(mh, jm, 100 / 2, costaRica.groupName));
  177.       // Tirimbina lunch
  178.       costaRica
  179.           .addPayment(ReceiptTransaction(rm, mh, 48 / 4, costaRica.groupName));
  180.       costaRica
  181.           .addPayment(ReceiptTransaction(rm, se, 48 / 4, costaRica.groupName));
  182.       costaRica
  183.           .addPayment(ReceiptTransaction(rm, jm, 48 / 4, costaRica.groupName));
  184.       // Spirit Airlines luggage fee
  185.       costaRica.addPayment(ReceiptTransaction(se, mh, 57, costaRica.groupName));
  186.       // Covid test
  187.       costaRica.addPayment(
  188.           ReceiptTransaction(se, rm, 98.16 / 2, costaRica.groupName));
  189.       // Starbucks Sandwich
  190.       costaRica.addPayment(
  191.           ReceiptTransaction(se, mh, 16.39 / 2, costaRica.groupName));
  192.       // Tirimbina Gift Shop
  193.       costaRica.addPayment(ReceiptTransaction(rm, mh, 12, costaRica.groupName));
  194.       costaRica.addPayment(ReceiptTransaction(rm, se, 1, costaRica.groupName));
  195.       // Burger King
  196.       costaRica
  197.           .addPayment(ReceiptTransaction(se, jm, 8 / 2, costaRica.groupName));
  198.  
  199.       costaRica.calculateMinimalPayments();
  200.  
  201.       expect(costaRica.transactions.length, 3);
  202.       expect(costaRica.transactions[0].toString(),
  203.           'Sender $mh, Receiver: $jm, Amount: 332.21, paid: false');
  204.       expect(costaRica.transactions[1].toString(),
  205.           'Sender $rm, Receiver: $se, Amount: 81.85, paid: false');
  206.       expect(costaRica.transactions[2].toString(),
  207.           'Sender $mh, Receiver: $se, Amount: 33.26, paid: false');
  208.     });
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×