123456789101112131415161718192021222324252627282930313233343536373839 |
-
- import org.junit.Assert;
- import org.junit.Test;
-
- public class ShortCalculatorTest
- {
- ShortCalculator test = new ShortCalculator();
- @Test
- public void sumTest(){
- short expected = (short)131070;
- short actual = test.sum((short)65535,(short)65535);
- Assert.assertEquals(expected,actual);
- }
- @Test
- public void differenceTest(){
- short expected = 679;
- short actual = test.difference((short)700,(short)21);
- Assert.assertEquals(expected,actual);
- }
- @Test
- public void productTest(){
- short expected = 6000;
- short actual = test.product((short)200,(short)30);
- Assert.assertEquals(expected,actual);
- }
- @Test
- public void quotientTest(){
- short expected = 600;
- short actual = test.quotient((short)18000,(short)30);
- Assert.assertEquals(expected,actual);
- }
- @Test
- public void remainderTest(){
- short expected = 1;
- short actual = test.remainder((short)18001,(short)18000);
- Assert.assertEquals(expected,actual);
- }
- }
|