ShortCalculatorTest.java 523B

12345678910111213141516171819202122232425
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. import org.junit.Assert;
  6. /**
  7. * The test class ShortCalculatorTest.
  8. *
  9. * @author (your name)
  10. * @version (a version number or a date)
  11. */
  12. public class ShortCalculatorTest
  13. {
  14. @Test
  15. public void addTest(){
  16. ShortCalculator shortCalculator = new ShortCalculator();
  17. short expected = 388;
  18. short actual = ShortCalculator.add((short)255,(short)133);
  19. Assert.assertEquals(expected, actual,0.01);
  20. }
  21. }