Write bunch of java to solve a series of requirements and pass a series of tests to prove your code works the way it should.

WriteLoopsTest.java 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. package FirstSaturday;
  2. import static org.junit.Assert.*;
  3. import org.junit.After;
  4. import org.junit.Before;
  5. import org.junit.Test;
  6. /**
  7. * The test class WriteLoopsTest.
  8. *
  9. * @author kyounger
  10. * @version 1.2
  11. */
  12. public class WriteLoopsTest
  13. {
  14. /**
  15. * Default constructor for test class WriteLoopsTest
  16. */
  17. public WriteLoopsTest()
  18. {
  19. }
  20. /**
  21. * Sets up the test fixture.
  22. *
  23. * Called before every test case method.
  24. */
  25. @Before
  26. public void setUp()
  27. {
  28. }
  29. /**
  30. * Tears down the test fixture.
  31. *
  32. * Called after every test case method.
  33. */
  34. @After
  35. public void tearDown()
  36. {
  37. }
  38. @Test
  39. public void TestOneToFive()
  40. {
  41. WriteLoops writeLoo1 = new WriteLoops();
  42. assertEquals(5, writeLoo1.oneToFive());
  43. }
  44. @Test
  45. public void TestOneToTen()
  46. {
  47. WriteLoops writeLoo1 = new WriteLoops();
  48. assertEquals(10, writeLoo1.oneToTen());
  49. }
  50. @Test
  51. public void TestStartAtTwentyOne()
  52. {
  53. WriteLoops writeLoo1 = new WriteLoops();
  54. assertEquals(11, writeLoo1.startAtTwentyOne());
  55. }
  56. @Test
  57. public void TestCountDown()
  58. {
  59. WriteLoops writeLoo1 = new WriteLoops();
  60. assertEquals(100, writeLoo1.countDown());
  61. }
  62. @Test
  63. public void Test2to32()
  64. {
  65. WriteLoops writeLoo1 = new WriteLoops();
  66. assertEquals(17, writeLoo1.byTwoTo32());
  67. }
  68. @Test
  69. public void TestCountDownFrom5000()
  70. {
  71. WriteLoops writeLoo1 = new WriteLoops();
  72. assertEquals(455, writeLoo1.countDownFrom5000());
  73. }
  74. @Test
  75. public void TestNestedFors()
  76. {
  77. WriteLoops writeLoo1 = new WriteLoops();
  78. assertEquals(100, writeLoo1.nestedFors());
  79. }
  80. @Test
  81. public void TestHelloZipCode()
  82. {
  83. WriteLoops writeLoo1 = new WriteLoops();
  84. assertEquals(47, writeLoo1.helloZipCode());
  85. }
  86. @Test
  87. public void TestDriveHome()
  88. {
  89. WriteLoops writeLoo1 = new WriteLoops();
  90. assertEquals(6, writeLoo1.driveHome());
  91. }
  92. @Test
  93. public void TestCheckGameScore()
  94. {
  95. WriteLoops writeLoo1 = new WriteLoops();
  96. assertEquals(3, writeLoo1.checkGameScore());
  97. }
  98. @Test
  99. public void TestCheckGameScoreDoWhile()
  100. {
  101. WriteLoops writeLoo1 = new WriteLoops();
  102. assertEquals(true, writeLoo1.checkGameScoreDoWhile());
  103. }
  104. @Test
  105. public void TestCheckServer()
  106. {
  107. WriteLoops writeLoo1 = new WriteLoops();
  108. assertEquals(3, writeLoo1.checkServerStatus());
  109. }
  110. }