Skip to content

Commit

Permalink
try to fix tests rev.9
Browse files Browse the repository at this point in the history
  • Loading branch information
MarieTask committed Jan 27, 2024
1 parent 3a4b7b9 commit 9ec25ac
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions app/src/test/java/hexlet/code/TestMapSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
public class TestMapSchema {
private MapSchema schema;
private static final int MIN_LENGTH = 3;
private static final int MAX_LENGTH = 100;
private static final int IN_RANGE = 25;
private static final int NEGATIVE = -5;
private static final int MIN = 18;
private static final int MAX = 35;


@BeforeEach
public void beforeEach() {
schema = Validator.map();
Expand Down Expand Up @@ -62,7 +66,7 @@ public void shapeTest1() {

Map<String, Object> human1 = new HashMap<>();
human1.put("name", "Kolya");
human1.put("age", 100);
human1.put("age", MAX_LENGTH);
assertTrue(schema.isValid(human1));

Map<String, Object> human2 = new HashMap<>();
Expand All @@ -77,8 +81,13 @@ public void shapeTest1() {

Map<String, Object> human4 = new HashMap<>();
human4.put("name", "Valya");
human4.put("age", -5);
human4.put("age", NEGATIVE);
assertFalse(schema.isValid(human4));

Map<String, Object> human5 = new HashMap<>();
human3.put("name", " ");
human3.put("age", null);
assertTrue(schema.isValid(human3));
}

@Test
Expand All @@ -91,7 +100,7 @@ public void shapeTest2() {

Map<String, Object> human1 = new HashMap<>();
human1.put("name", "Kolya");
human1.put("age", 100);
human1.put("age", MAX_LENGTH);
assertFalse(schema.isValid(human1));

Map<String, Object> human2 = new HashMap<>();
Expand All @@ -106,7 +115,7 @@ public void shapeTest2() {

Map<String, Object> human4 = new HashMap<>();
human4.put("name", "Valya");
human4.put("age", 25);
human4.put("age", IN_RANGE);
assertTrue(schema.isValid(human4));
}

Expand Down

0 comments on commit 9ec25ac

Please sign in to comment.