Skip to content

Test all mock implementations #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions src/test/java/net/andreinc/mockneat/unit/text/StringsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public void testVariableSizes() {
loop(
STRING_CYCLES,
MOCKS,
(m) -> {
int size = M.ints().range(100, 1000).val();
String sized = M.strings().size(size).val();
m -> {
int size = m.ints().range(100, 1000).val();
String sized = m.strings().size(size).val();
assertEquals(size, sized.length());
}
);
Expand All @@ -50,9 +50,9 @@ public void testNumbers() {
loop(
STRING_CYCLES,
MOCKS,
(m) -> {
int size = M.ints().range(10, 100).val();
String numeric = M.strings().size(size).type(NUMBERS).val();
m -> {
int size = m.ints().range(10, 100).val();
String numeric = m.strings().size(size).type(NUMBERS).val();
assertEquals(size, numeric.length());
assertTrue(isNumeric(numeric));
}
Expand All @@ -64,9 +64,9 @@ public void testLetters() {
loop(
STRING_CYCLES,
MOCKS,
(m) -> {
int size = M.ints().range(10, 100).val();
String letters = M.strings().size(size).type(LETTERS).val();
m -> {
int size = m.ints().range(10, 100).val();
String letters = m.strings().size(size).type(LETTERS).val();
assertEquals(size, letters.length());
assertTrue(isAlpha(letters));
}
Expand All @@ -78,9 +78,9 @@ public void testAlphaNumeric() {
loop(
STRING_CYCLES,
MOCKS,
(m) -> {
int size = M.ints().range(10, 100).val();
String alphaNumeric = M.strings().size(size).type(ALPHA_NUMERIC).val();
m -> {
int size = m.ints().range(10, 100).val();
String alphaNumeric = m.strings().size(size).type(ALPHA_NUMERIC).val();
assertEquals(size, alphaNumeric.length());
assertTrue(isAlphanumeric(alphaNumeric));
}
Expand All @@ -92,9 +92,9 @@ public void testSpecialCharacters() {
loop(
STRING_CYCLES,
MOCKS,
(m) -> {
int size = M.ints().range(10, 100).val();
String specialChars = M.strings().size(size).type(SPECIAL_CHARACTERS).val();
m -> {
int size = m.ints().range(10, 100).val();
String specialChars = m.strings().size(size).type(SPECIAL_CHARACTERS).val();
assertEquals(size, specialChars.length());
verifySpecialChars(specialChars);
}
Expand All @@ -113,9 +113,9 @@ public void testHex() {
loop(
STRING_CYCLES,
MOCKS,
(m) -> {
int size = M.ints().range(10, 100).val();
String hex = M.strings().size(size).type(HEX).val();
m -> {
int size = m.ints().range(10, 100).val();
String hex = m.strings().size(size).type(HEX).val();
assertEquals(size, hex.length());
verifyHex(hex);
}
Expand Down