-
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.
- Loading branch information
Showing
9 changed files
with
169 additions
and
4 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package learnmind.state; | ||
|
||
|
||
import java.util.Random; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Tests for {@link Code}. | ||
* @since 0.1 | ||
*/ | ||
public final class CodeTest { | ||
|
||
/** | ||
* {@link Code} could be built using a string representation. | ||
*/ | ||
@Test | ||
public void buildsAsString() { | ||
final Random rnd = new Random(); | ||
final Code code = new RandomCode(rnd.nextInt(9) + 1); | ||
MatcherAssert.assertThat(new Code(code.toString()), Matchers.equalTo(new Code(code.num()))); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package learnmind.state; | ||
|
||
|
||
import java.util.Random; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Tests for {@link Result}. | ||
* @since 0.1 | ||
*/ | ||
public final class ResultTest { | ||
|
||
/** | ||
* {@link Result} could be built using a string representation. | ||
*/ | ||
@Test | ||
public void buildsAsString() { | ||
final Random rnd = new Random(); | ||
final Result result = new Result(rnd.nextInt(5), rnd.nextInt(5)); | ||
MatcherAssert.assertThat(new Result(result.toString()), Matchers.equalTo(result)); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package learnmind.state; | ||
|
||
|
||
import java.util.Random; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Tests for {@link Row}. | ||
* @since 0.1 | ||
*/ | ||
public final class RowTest { | ||
|
||
/** | ||
* {@link Row} could be built using a string representation. | ||
*/ | ||
@Test | ||
public void buildsAsString() { | ||
final Random rnd = new Random(); | ||
final Result result = new Result(rnd.nextInt(5), rnd.nextInt(5)); | ||
final Code code = new Code(new RandomCode(rnd.nextInt(9) + 1).num()); | ||
final Row row = new Row(code, result); | ||
MatcherAssert.assertThat(new Row(row.toString()), Matchers.equalTo(row)); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package learnmind.state; | ||
|
||
|
||
import java.util.Random; | ||
import org.hamcrest.MatcherAssert; | ||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
|
||
/** | ||
* Tests for {@link State}. | ||
* @since 0.1 | ||
*/ | ||
public final class StateTest { | ||
|
||
/** | ||
* {@link State} could be built using a string representation. | ||
*/ | ||
@Test | ||
public void buildsAsString() { | ||
final Random rnd = new Random(); | ||
final Result result = new Result(rnd.nextInt(5), rnd.nextInt(5)); | ||
final Code code = new Code(new RandomCode(rnd.nextInt(9) + 1).num()); | ||
final Row row = new Row(code, result); | ||
MatcherAssert.assertThat(new Row(row.toString()), Matchers.equalTo(row)); | ||
} | ||
|
||
} |