removed unnecessary Mockito and refactored test method name

This commit is contained in:
Tom Hombergs 2018-10-01 21:06:19 +02:00
parent 0f18f2844d
commit 2784b3de4c
1 changed files with 2 additions and 4 deletions

View File

@ -7,14 +7,12 @@ import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
@RunWith(MockitoJUnitRunner.class)
public class NthRootCalculatorUnitTest {
@InjectMocks
private NthRootCalculator nthRootCalculator;
private NthRootCalculator nthRootCalculator = new NthRootCalculator();
@Test
public void giventThatTheBaseIs125_andTheExpIs3_whenCalculateIsCalled_thenTheResultIsTheCorrectOne() {
public void whenBaseIs125AndNIs3_thenNthRootIs5() {
Double result = nthRootCalculator.calculate(125.0, 3.0);
assertEquals(result, (Double) 5.0d);
}