diff options
author | pacien | 2019-03-29 16:30:32 +0100 |
---|---|---|
committer | pacien | 2019-03-29 16:30:32 +0100 |
commit | 11a6ff02601d9fd04544d6cd96dec99b26464d40 (patch) | |
tree | ff371e06645172014a8725e6e8976128c499a6b4 /src/test | |
parent | f2daad5dafe10740e23826abb450e3dc53d76b93 (diff) | |
download | java-lemonad-11a6ff02601d9fd04544d6cd96dec99b26464d40.tar.gz |
add missing method test
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/pacien/lemonad/validation/ValidationTest.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/java/org/pacien/lemonad/validation/ValidationTest.java b/src/test/java/org/pacien/lemonad/validation/ValidationTest.java index 665f501..fed74a3 100644 --- a/src/test/java/org/pacien/lemonad/validation/ValidationTest.java +++ b/src/test/java/org/pacien/lemonad/validation/ValidationTest.java | |||
@@ -20,6 +20,7 @@ package org.pacien.lemonad.validation; | |||
20 | 20 | ||
21 | import org.junit.jupiter.api.Assertions; | 21 | import org.junit.jupiter.api.Assertions; |
22 | import org.junit.jupiter.api.Test; | 22 | import org.junit.jupiter.api.Test; |
23 | import org.pacien.lemonad.attempt.Attempt; | ||
23 | 24 | ||
24 | import java.util.List; | 25 | import java.util.List; |
25 | import java.util.stream.Stream; | 26 | import java.util.stream.Stream; |
@@ -41,6 +42,7 @@ class ValidationTest { | |||
41 | assertFalse(validation.isInvalid()); | 42 | assertFalse(validation.isInvalid()); |
42 | validation.ifValid(innerSubject -> assertEquals(subject, innerSubject)); | 43 | validation.ifValid(innerSubject -> assertEquals(subject, innerSubject)); |
43 | validation.ifInvalid((__, ___) -> fail()); | 44 | validation.ifInvalid((__, ___) -> fail()); |
45 | assertEquals(Attempt.success(subject), validation.toAttempt()); | ||
44 | } | 46 | } |
45 | 47 | ||
46 | @Test void testInvalidResult() { | 48 | @Test void testInvalidResult() { |
@@ -55,6 +57,7 @@ class ValidationTest { | |||
55 | assertEquals(subject, innerSubject); | 57 | assertEquals(subject, innerSubject); |
56 | assertEquals(errors, innerErrors); | 58 | assertEquals(errors, innerErrors); |
57 | }); | 59 | }); |
60 | assertEquals(Attempt.failure(errors), validation.toAttempt()); | ||
58 | } | 61 | } |
59 | 62 | ||
60 | @Test void testFlatMap() { | 63 | @Test void testFlatMap() { |