1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
-
- import static org.junit.Assert.*;
- import org.junit.Test;
- import java.math.BigDecimal;
-
- /**
- * The test class BonusFeaturesTest.
- */
- public class BonusFeaturesTest
- {
- private Console console = new Console();
- private BonusFeatures bonus = new BonusFeatures(console);
-
- @Test
- public void factorialOfTest(){
- //Given
-
- Double test1 = 100.00;
- //When
- Double actual = (9.33262154439441E157);
- Double expected = bonus.factorialOf(test1);
- //Then
- assertEquals(expected,actual);
- }
-
- @Test
- public void logarithmTest(){
- //Given
-
- Double test1 = 10.00;
- //When
- double actual = 1.00;
- double expected = bonus.logarithm(test1);
- //Then
- assertEquals(expected,actual, 0);
- }
-
- @Test
- public void invLogarithmTest(){
- //Given
-
- Double test1 = 10.00;
- //When
- double actual = 10000000000.00;
- double expected = bonus.invLogarithm(test1);
- //Then
- assertEquals(expected,actual,0);
- }
-
- @Test
- public void lnLogarithmTest(){
- //Given
-
- Double test1 = Math.exp(1);
- //When
- double actual = 1;
- double expected = bonus.lnLogarithm(test1);
- //Then
- assertEquals(expected,actual, 0);
- }
-
- @Test
- public void expLogarithmTest(){
- //Given
-
- Double test1 = 0.00;
- //When
- double actual = 1;
- double expected = bonus.expLogarithm(test1);
- //Then
- assertEquals(expected,actual, 0);
- }
- }
|