Merge pull request #5373 from eugenp/fix-nth-root

removed unnecessary Mockito and refactored test method name
This commit is contained in:
Loredana Crusoveanu 2018-10-27 11:17:14 +03:00 committed by GitHub
commit 4e53cd8046
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

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