daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest Nov 24th, 2017 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.           // Test 1: get rank
  2.           NameRecord name = new NameRecord("Yaritza 0 0 0 0 0 0 0 0 694 930 0");
  3.           int expected = 930;
  4.           int actual = name.getRank(9);
  5.           System.out.println("Test 1 get rank: expected value: " +
  6.                   expected + ", actual value: " + actual);
  7.           if( expected == actual )          
  8.               System.out.println("PASSED Test 1, get rank");
  9.           else
  10.               System.out.println("***** FAILED ***** Test 1, get rank");
  11.          
  12.           // Test 2: get rank
  13.           name = new NameRecord("Eldon 384 266 262 247 330 464 699 891 0 0 0");
  14.           expected = 247;
  15.           actual = name.getRank(3);
  16.           System.out.println("\nTest 2 get rank: expected value: " +
  17.                   expected + ", actual value: " + actual);
  18.           if( expected == actual )          
  19.               System.out.println("PASSED Test 2, get rank");
  20.           else
  21.               System.out.println("***** FAILED ***** Test 2, get rank");
  22.            
  23.               // Test 3: best decade
  24.               name = new NameRecord("Adama 0 1 0 1 0 1 0 1 0 1 0");
  25.           expected = 1990;
  26.           actual = name.bestDecade();
  27.           System.out.println("\nTest 3 best decade: expected value: " +
  28.                   expected + ", actual value: " + actual);
  29.           if( expected == actual )          
  30.               System.out.println("PASSED Test 3, best decade");
  31.           else
  32.               System.out.println("***** FAILED ***** Test 3, best decade");
  33.          
  34.           // Test 4: best decade
  35.           name = new NameRecord("Victor 79 67 79 97 91 91 89 92 88 83 94");
  36.           expected = 1910;
  37.           actual = name.bestDecade();
  38.           System.out.println("\nTest 4 best decade: expected value: " +
  39.                   expected + ", actual value: " + actual);
  40.           if( expected == actual )          
  41.               System.out.println("PASSED Test 4, best decade");
  42.           else
  43.               System.out.println("***** FAILED ***** Test 4, best decade");
  44.          
  45.           // Test 5: years ranked
  46.           name = new NameRecord("Edmond 279 287 290 366 397 417 568 741 953 0 0");
  47.           expected = 9;
  48.           actual = name.yearsRanked();
  49.           System.out.println("\nTest 5 years ranked: expected value: " +
  50.                   expected + ", actual value: " + actual);
  51.           if( expected == actual )          
  52.               System.out.println("PASSED Test 5, years ranked");
  53.           else
  54.               System.out.println("***** FAILED ***** Test 5, years ranked");
  55.          
  56.           // Test 6: years ranked
  57.           name = new NameRecord("Starbuck 0 0 0 0 0 0 0 0 0 0 0");
  58.           expected = 0;
  59.           actual = name.yearsRanked();
  60.           System.out.println("\nTest 6 years ranked: expected value: " +
  61.                   expected + ", actual value: " + actual);
  62.           if( expected == actual )          
  63.               System.out.println("PASSED Test 6, years ranked");
  64.           else
  65.               System.out.println("***** FAILED ***** Test 6, years ranked");
  66.          
  67.           // Test 7: ranked all
  68.           name = new NameRecord("Mark 194 215 226 199 57 9 6 18 33 49 80");
  69.           boolean expectedBool = true;
  70.           boolean actualBool = name.isRankedAll();
  71.           System.out.println("\nTest 7 ranked all: expected value: " +
  72.                   expectedBool + ", actual value: " + actualBool);
  73.           if( expectedBool == actualBool )          
  74.               System.out.println("PASSED Test 7, ranked all");
  75.           else
  76.               System.out.println("***** FAILED ***** Test 7, ranked all");
  77.          
  78.           // Test 8: ranked all
  79.           name = new NameRecord("Judy 0 675 464 110 17 27 79 268 444 781 0");
  80.           expectedBool = false;
  81.           actualBool = name.isRankedAll();
  82.           System.out.println("\nTest 8 ranked all: expected value: " +
  83.                   expectedBool + ", actual value: " + actualBool);
  84.           if( expectedBool == actualBool )          
  85.               System.out.println("PASSED Test 8, ranked all");
  86.           else
  87.               System.out.println("***** FAILED ***** Test 8, ranked all");
  88.          
  89.           // Test 9: ranked once
  90.           name = new NameRecord("Afton 0 964 0 0 0 0 0 0 0 0 0");
  91.           expectedBool = true;
  92.           actualBool = name.isRankedOnce();
  93.           System.out.println("\nTest 9 ranked once: expected value: " +
  94.                   expectedBool + ", actual value: " + actualBool);
  95.           if( expectedBool == actualBool )          
  96.               System.out.println("PASSED Test 9, ranked once");
  97.           else
  98.               System.out.println("***** FAILED ***** Test 9, ranked once");
  99.          
  100.           // Test 10: ranked once
  101.           name = new NameRecord("Gaius 0 0 0 0 0 0 0 0 0 0 0");
  102.           expectedBool = false;
  103.           actualBool = name.isRankedOnce();
  104.           System.out.println("\nTest 10 ranked once: expected value: " +
  105.                   expectedBool + ", actual value: " + actualBool);
  106.           if( expectedBool == actualBool )          
  107.               System.out.println("PASSED Test 10, ranked once");
  108.           else
  109.               System.out.println("***** FAILED ***** Test 10, ranked once");
  110.          
  111.           // Test 11: ranked once
  112.           name = new NameRecord("Adam 178 200 280 376 444 407 144 38 22 39 46");
  113.           expectedBool = false;
  114.           actualBool = name.isRankedOnce();
  115.           System.out.println("\nTest 11 ranked once: expected value: " +
  116.                   expectedBool + ", actual value: " + actualBool);
  117.           if( expectedBool == actualBool )          
  118.               System.out.println("PASSED Test 11, ranked once");
  119.           else
  120.               System.out.println("***** FAILED ***** Test 11, ranked once");
  121.          
  122.           // Test 12: is more popular
  123.           name = new NameRecord("Apollo 0 950 900 875 850 800 750 700 650 600 500 400");
  124.           expectedBool = true;
  125.           actualBool = name.isMorePopular();
  126.           System.out.println("\nTest 12 is more popular: expected value: " +
  127.                   expectedBool + ", actual value: " + actualBool);
  128.           if( expectedBool == actualBool )          
  129.               System.out.println("PASSED Test 12, is more popular");
  130.           else
  131.               System.out.println("***** FAILED ***** Test 12, is more popular");
  132.          
  133.           // Test 13: is more popular
  134.           name = new NameRecord("Chief 11 10 9 8 7 6 5 4 3 2 1 0");
  135.           expectedBool = false;
  136.           actualBool = name.isMorePopular();
  137.           System.out.println("\nTest 13 is more popular: expected value: " +
  138.                   expectedBool + ", actual value: " + actualBool);
  139.           if( expectedBool == actualBool )          
  140.               System.out.println("PASSED Test 13, is more popular");
  141.           else
  142.               System.out.println("***** FAILED ***** Test 13, is more popular");
  143.          
  144.           // Test 14: is more popular
  145.           name = new NameRecord("Helio 0 0 0 0 0 0 0 0 0 0 0");
  146.           expectedBool = false;
  147.           actualBool = name.isMorePopular();
  148.           System.out.println("\nTest 14 is more popular: expected value: " +
  149.                   expectedBool + ", actual value: " + actualBool);
  150.           if( expectedBool == actualBool )          
  151.               System.out.println("PASSED Test 14, is more popular");
  152.           else
  153.               System.out.println("***** FAILED ***** Test 14, is more popular");
  154.          
  155.           // Test 15: is less popular
  156.           name = new NameRecord("namey 100 150 200 202 250 300 350 400 450 460 0");
  157.           expectedBool = true;
  158.           actualBool = name.isLessPopular();
  159.           System.out.println("\nTest 15 is less popular: expected value: " +
  160.                   expectedBool + ", actual value: " + actualBool);
  161.           if( expectedBool == actualBool )          
  162.               System.out.println("PASSED Test 15, is less popular");
  163.           else
  164.               System.out.println("***** FAILED ***** Test 15, is less popular");
  165.          
  166.           // Test 16: is less popular
  167.           name = new NameRecord("Boomer 100 150 200 202 250 300 350 400 0 0 0");
  168.           expectedBool = false;
  169.           actualBool = name.isLessPopular();
  170.           System.out.println("\nTest 16 is less popular: expected value: " +
  171.                   expectedBool + ", actual value: " + actualBool);
  172.           if( expectedBool == actualBool )          
  173.               System.out.println("PASSED Test 16, is less popular");
  174.           else
  175.               System.out.println("***** FAILED ***** Test 16, is less popular");
  176.          
  177.           // Test 17: is less popular
  178.           name = new NameRecord("Alfred 0 40 42 61 92 120 164 224 296 434 575");
  179.           expectedBool = false;
  180.           actualBool = name.isLessPopular();
  181.           System.out.println("\nTest 17 is less popular: expected value: " +
  182.                   expectedBool + ", actual value: " + actualBool);
  183.           if( expectedBool == actualBool )          
  184.               System.out.println("PASSED Test 17, is less popular");
  185.           else
  186.               System.out.println("***** FAILED ***** Test 17, is less popular");
RAW Paste Data
Top