import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; // TODO: Replace examples and use TDD by writing your own tests class SolutionTest { @Test void testSpeedLimit() { assertEquals(0, Kata.speedLimit(60, new int[] {80,70,60 })); assertEquals(250, Kata.speedLimit(100, new int[]{110,100,80})); assertEquals(500, Kata.speedLimit(130, new int[]{140,130,100})); assertEquals(100, Kata.speedLimit(110, new int[]{120,110,100})); } @Test void emptyTest() { assertEquals(0, Kata.speedLimit(0, new int[]{15,25,35,46,})); assertEquals(0, Kata.speedLimit(60, new int[] {})); } }
- import org.junit.jupiter.api.Test;
- import static org.junit.jupiter.api.Assertions.assertEquals;
- // TODO: Replace examples and use TDD by writing your own tests
- class SolutionTest {
- @Test
- void testSpeedLimit() {
- assertEquals(0, Kata.speedLimit(60, new int[] {80,70,60 }));
- assertEquals(250, Kata.speedLimit(100, new int[]{110,100,80}));
- assertEquals(500, Kata.speedLimit(130, new int[]{140,130,100}));
- assertEquals(100, Kata.speedLimit(110, new int[]{120,110,100}));
- }
- @Test
- void emptyTest() {
- assertEquals(0, Kata.speedLimit(0, new int[]{15,25,35,46,}));
- assertEquals(0, Kata.speedLimit(60, new int[] {}));
- }
- }
import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; // TODO: Replace examples and use TDD by writing your own tests class SolutionTest { @Test void testSpeedLimit() { assertEquals(0, Kata.speedLimit(60, new int[] {80,70,60 })); assertEquals(250, Kata.speedLimit(100, new int[]{110,100,80})); assertEquals(500, Kata.speedLimit(130, new int[]{140,130,100})); } @Test void emptyTest() { assertEquals(0, Kata.speedLimit(0, new int[]{15,25,35,46,})); assertEquals(0, Kata.speedLimit(60, new int[] {})); } }
- import org.junit.jupiter.api.Test;
- import static org.junit.jupiter.api.Assertions.assertEquals;
- // TODO: Replace examples and use TDD by writing your own tests
- class SolutionTest {
@Testvoid testSomething() {// assertEquals("expected", "actual");}}- @Test
- void testSpeedLimit() {
- assertEquals(0, Kata.speedLimit(60, new int[] {80,70,60 }));
- assertEquals(250, Kata.speedLimit(100, new int[]{110,100,80}));
- assertEquals(500, Kata.speedLimit(130, new int[]{140,130,100}));
- }
- @Test
- void emptyTest() {
- assertEquals(0, Kata.speedLimit(0, new int[]{15,25,35,46,}));
- assertEquals(0, Kata.speedLimit(60, new int[] {}));
- }
- }