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