ShortCalculatorTest.java 571B

1234567891011121314151617181920212223242526272829
  1. import org.junit.Assert;
  2. import org.junit.Before;
  3. import org.junit.Test;
  4. public class ShortCalculatorTest {
  5. private ShortCalculator ShortCalc;
  6. @Before
  7. public void setUp(){
  8. ShortCalc = new ShortCalculator();
  9. }
  10. @Test
  11. public void shortValuesTest(){
  12. // :Given
  13. Short[] expected = {6, 2, 8, 2, 0};
  14. short testnum = 4;
  15. short testnum2 = 2;
  16. // :When
  17. Short[] actual = ShortCalc.shortValues(testnum, testnum2);
  18. // :Then
  19. Assert.assertEquals(expected, actual);
  20. }
  21. }