Advertisement
What_Ever

Untitled

Mar 18th, 2016
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.06 KB | None | 0 0
  1. package eg.edu.alexu.csd.datastructure.iceHockey.cs69;
  2.  
  3. import static org.junit.Assert.*;
  4.  
  5. import java.awt.Point;
  6.  
  7. import eg.edu.alexu.csd.datastructure.iceHockey.IPlayersFinder;
  8.  
  9. public class Test {
  10.    
  11.     IPlayersFinder o = new IceHockey();
  12.     @org.junit.Test
  13.     public void test1() {
  14.         String[] arr = {
  15.                 "33JUBU33",
  16.                 "3U3O4433",
  17.                 "O33P44NB",
  18.                 "PO3NSDP3",
  19.                 "VNDSD333",
  20.                 "OINFD33X"
  21.                 };
  22.         Point[] p = {new Point(4,5),new Point (13,9),new Point (14,2)};
  23.         assertArrayEquals(p, o.findPlayers(arr, 3, 16));
  24.     }
  25.     @org.junit.Test
  26.     public void test2() {
  27.         String[] arr = {
  28.                     "44444H44S4",
  29.                     "K444K4L444",
  30.                     "4LJ44T44XH",
  31.                     "444O4VIF44",
  32.                     "44C4D4U444",
  33.                     "4V4Y4KB4M4",
  34.                     "G4W4HP4O4W",
  35.                     "4444ZDQ4S4",
  36.                     "4BR4Y4A444",
  37.                     "4G4V4T4444"
  38.                 };
  39.         Point[] p = {new Point(3,8),new Point (4,16),new Point (5,4),new Point
  40.                 (16,3),new Point (16,17),new Point (17,9)};
  41.         assertArrayEquals(p, o.findPlayers(arr, 4, 16));
  42.     }
  43.    
  44.     @org.junit.Test
  45.     public void test3() {
  46.         String[] arr = {
  47.                 "8D88888J8L8E888",
  48.                 "88NKMG8N8E8JI88",
  49.                 "888NS8EU88HN8EO",
  50.                 "LUQ888A8TH8OIH8",
  51.                 "888QJ88R8SG88TY",
  52.                 "88ZQV88B88OUZ8O",
  53.                 "FQ88WF8Q8GG88B8",
  54.                 "8S888HGSB8FT8S8",
  55.                 "8MX88D88888T8K8",
  56.                 "8S8A88MGVDG8XK8",
  57.                 "M88S8B8I8M88J8N",
  58.                 "8W88X88ZT8KA8I8",
  59.                 "88SQGB8I8J88W88",
  60.                 "U88H8NI8CZB88B8",
  61.                 "8PK8H8T8888TQR8"
  62.                 };
  63.         Point[] p = {new Point(1, 17),new Point (3, 3),new Point (3, 10),
  64.                 new Point(3, 25), new Point(5, 21), new Point(8, 17),
  65.                 new Point(9, 2), new Point(10,9),new Point (12,23),
  66.                 new Point(17,16),new Point (18,3),new Point (18,11),
  67.                 new Point(18,28),new Point (22,20), new Point(23,26),
  68.                 new Point(24,15), new Point(27,2),new Point (28,26),
  69.                 new Point(29,16)};
  70.         assertArrayEquals(p, o.findPlayers(arr, 8, 9));
  71.     }
  72.     @org.junit.Test
  73.     public void test4() {
  74.         String[] arr = {
  75.                 "11111",
  76.                 "1AAA1",
  77.                 "1A1A1",
  78.                 "1AAA1",
  79.                 "11111"
  80.                 };
  81.         Point[] p = {new Point(5,5), new Point(5,5)};
  82.         assertArrayEquals(p, o.findPlayers(arr, 1, 3));
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement