Advertisement
Guest User

corentin

a guest
Jun 24th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. @Test
  2. public void testconstructeurSousMarin1Ex() throws BadCoordException {
  3.  
  4. Assertions.assertThrows(BadCoordException.class,
  5. () -> { s = new Submarine("SousMarin","A11");}
  6. );
  7.  
  8. }
  9.  
  10. @Test
  11. public void testconstructeurSousMarin2Ex() throws BadCoordException {
  12.  
  13. Assertions.assertThrows(BadCoordException.class,
  14. () -> { s = new Submarine("SousMarin","J0");}
  15. );
  16.  
  17. }
  18.  
  19. @Test
  20. void testconstructeurSousMarin1() throws CoordsBadShipException {
  21. try {
  22. s = new Submarine("SousMarin","J10");
  23. } catch (BadCoordException e) {
  24. e.printStackTrace();
  25. }
  26.  
  27. }
  28.  
  29. @Test
  30. void testconstructeurSousMarin2() throws CoordsBadShipException {
  31. try {
  32. s = new Submarine("SousMarin","a1");
  33. } catch (BadCoordException e) {
  34. e.printStackTrace();
  35. }
  36. }
  37.  
  38. @Test
  39. public void testconstructeurDestroyer1ExC() throws CoordsBadShipException {
  40.  
  41. Assertions.assertThrows(CoordsBadShipException.class,
  42. () -> { s = new Destroyer("Destroyer","A1","A4");}
  43. );
  44.  
  45. }
  46. @Test
  47. public void testconstructeurDestroyer2ExC() throws CoordsBadShipException {
  48.  
  49. Assertions.assertThrows(CoordsBadShipException.class,
  50. () -> { s = new Destroyer("Destroyer","A1","D1");}
  51. );
  52.  
  53. }
  54. @Test
  55. public void testconstructeurDestroyer3ExC() throws CoordsBadShipException {
  56.  
  57. Assertions.assertThrows(CoordsBadShipException.class,
  58. () -> { s = new Destroyer("Destroyer","A1","D5");}
  59. );
  60.  
  61. }
  62. @Test
  63. public void testconstructeurDestroyer4ExC() throws CoordsBadShipException {
  64.  
  65. Assertions.assertThrows(CoordsBadShipException.class,
  66. () -> { s = new Destroyer("Destroyer","A1","B1");}
  67. );
  68.  
  69. }
  70. @Test
  71. public void testconstructeurDestroyer5ExC() throws CoordsBadShipException {
  72.  
  73. Assertions.assertThrows(CoordsBadShipException.class,
  74. () -> { s = new Destroyer("Destroyer","A1","A1");}
  75. );
  76.  
  77. }
  78.  
  79. @Test
  80. void testconstructeurDestroyer1() throws CoordsBadShipException {
  81. try {
  82. s = new Destroyer("Destroyer","A1","A2");
  83. } catch (BadCoordException e) {
  84. e.printStackTrace();
  85. }
  86.  
  87. }
  88. @Test
  89. void testconstructeurDestroyer2() throws CoordsBadShipException {
  90. try {
  91. s = new Destroyer("Destroyer","A1","B1");
  92. } catch (BadCoordException e) {
  93. e.printStackTrace();
  94. }
  95.  
  96. }
  97.  
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement