bonusFunctionsTest.java 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import org.junit.Assert;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class bonusFunctionsTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class bonusFunctionsTest
  12. {
  13. private bonusFunctions bonusFunctions;
  14. @Before
  15. public void setUp(){
  16. bonusFunctions = new bonusFunctions();
  17. }
  18. @Test
  19. public void naturalLogLnTest(){
  20. // :Given
  21. Double expected = 0.0;
  22. // :When
  23. Double actual = bonusFunctions.naturalLogLn(1.0);
  24. // :Then
  25. Assert.assertEquals(expected, actual);
  26. }
  27. @Test
  28. public void LogBaseTenOfAnumberTest(){
  29. // :Given
  30. Double expected = 1.0;
  31. // :When
  32. Double actual = bonusFunctions.LogBaseTenOfAnumber(10.0);
  33. // :Then
  34. Assert.assertEquals(expected, actual);
  35. }
  36. @Test
  37. public void exponentialTest(){
  38. // :Given
  39. Double expected = 2.7182818285;
  40. // :When
  41. Double actual = bonusFunctions.exponential(1.0);
  42. // :Then
  43. Assert.assertEquals(expected, actual, 0.10);
  44. }
  45. }