forked from exercism/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update tests to use assertj (exercism#2147)
- Loading branch information
1 parent
438b3ed
commit f703a80
Showing
9 changed files
with
130 additions
and
158 deletions.
There are no files selected for viewing
14 changes: 7 additions & 7 deletions
14
exercises/practice/collatz-conjecture/src/test/java/CollatzCalculatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,87 @@ | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class DartsTest { | ||
|
||
Darts darts = new Darts(); | ||
@Test | ||
public void missedTarget() { | ||
assertEquals(0, darts.score(-9, 9)); | ||
assertThat(darts.score(-9, 9)).isEqualTo(0); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void onTheOuterCircle() { | ||
assertEquals(1, darts.score(0, 10)); | ||
assertThat(darts.score(0, 10)).isEqualTo(1); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void onTheMiddleCircle() { | ||
assertEquals(5, darts.score(-5, 0)); | ||
assertThat(darts.score(-5, 0)).isEqualTo(5); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void onTheInnerCircle() { | ||
assertEquals(10, darts.score(0, -1)); | ||
assertThat(darts.score(0, -1)).isEqualTo(10); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void exactlyOnCentre() { | ||
assertEquals(10, darts.score(0, 0)); | ||
assertThat(darts.score(0, 0)).isEqualTo(10); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void nearTheCentre() { | ||
assertEquals(10, darts.score(-0.1, -0.1)); | ||
assertThat(darts.score(-0.1, -0.1)).isEqualTo(10); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void justWithinTheInnerCircle() { | ||
assertEquals(10, darts.score(0.7, 0.7)); | ||
assertThat(darts.score(0.7, 0.7)).isEqualTo(10); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void justOutsideTheInnerCircle() { | ||
assertEquals(5, darts.score(0.8, -0.8)); | ||
assertThat(darts.score(0.8, -0.8)).isEqualTo(5); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void justWithinTheMiddleCircle() { | ||
assertEquals(5, darts.score(-3.5, 3.5)); | ||
assertThat(darts.score(-3.5, 3.5)).isEqualTo(5); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void justOutsideTheMiddleCircle() { | ||
assertEquals(1, darts.score(-3.6, -3.6)); | ||
assertThat(darts.score(-3.6, -3.6)).isEqualTo(1); | ||
} | ||
|
||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void justWithinTheOuterCircle() { | ||
assertEquals(1, darts.score(-7.0, 7.0)); | ||
assertThat(darts.score(-7.0, 7.0)).isEqualTo(1); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void justOutsideTheOuterCircle() { | ||
assertEquals(0, darts.score(7.1, -7.1)); | ||
assertThat(darts.score(7.1, -7.1)).isEqualTo(0); | ||
} | ||
|
||
@Ignore("Remove to run test") | ||
@Test | ||
public void asymmetricPositionBetweenTheInnerAndMiddleCircles() { | ||
assertEquals(5, darts.score(0.5, -4)); | ||
assertThat(darts.score(0.5, -4)).isEqualTo(5); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.