NormalizeAngleTest.java 833B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import org.junit.Assert;
  2. import org.junit.Before;
  3. import org.junit.Test;
  4. public class NormalizeAngleTest {
  5. private NormalizeAngle normalizeAngle;
  6. @Before
  7. public void setUp(){
  8. normalizeAngle = new NormalizeAngle();
  9. }
  10. @Test
  11. public void normalizeValueUsingModuloTest(){
  12. //:Given
  13. Integer expected = 60;
  14. //:When
  15. Integer actual = normalizeAngle.normalizeValueUsingModulo(780);
  16. //:Then
  17. Assert.assertEquals("The value equals 60", expected, actual);
  18. }
  19. @Test
  20. public void normalizeValueUsingFloorModTest(){
  21. //:Given
  22. Integer expected = 60;
  23. //:When
  24. Integer actual = normalizeAngle.normalizeValueUsingFloorMod(780);
  25. //:Then
  26. Assert.assertEquals("The value equals 60", expected, actual);
  27. }
  28. }