Daniel Hauch
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
0 additions and
29 deletions
-
src/TestBmi.java
|
|
@ -1,29 +0,0 @@ |
|
|
|
import org.junit.Before; |
|
|
|
import org.junit.jupiter.api.Test; |
|
|
|
|
|
|
|
import static org.hamcrest.MatcherAssert.assertThat; |
|
|
|
import static org.hamcrest.core.IsEqual.equalTo; |
|
|
|
|
|
|
|
public class TestBmi { |
|
|
|
private Bmi bmi; |
|
|
|
|
|
|
|
@Before |
|
|
|
public void setup() { |
|
|
|
bmi = new Bmi(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void normalBmi() { |
|
|
|
//arrange |
|
|
|
Bmi bmi = new Bmi(); |
|
|
|
float height = (float) 1.70; |
|
|
|
float weight = 70; |
|
|
|
int expectedResult = 24; |
|
|
|
|
|
|
|
//act |
|
|
|
int bmiResult = bmi.calculate(height, weight); |
|
|
|
|
|
|
|
//assert |
|
|
|
assertThat("", bmiResult, equalTo(expectedResult)); |
|
|
|
} |
|
|
|
} |