aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpacien2019-03-29 16:30:32 +0100
committerpacien2019-03-29 16:30:32 +0100
commit11a6ff02601d9fd04544d6cd96dec99b26464d40 (patch)
treeff371e06645172014a8725e6e8976128c499a6b4 /src
parentf2daad5dafe10740e23826abb450e3dc53d76b93 (diff)
downloadjava-lemonad-11a6ff02601d9fd04544d6cd96dec99b26464d40.tar.gz
add missing method test
Diffstat (limited to 'src')
-rw-r--r--src/test/java/org/pacien/lemonad/validation/ValidationTest.java3
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
21import org.junit.jupiter.api.Assertions; 21import org.junit.jupiter.api.Assertions;
22import org.junit.jupiter.api.Test; 22import org.junit.jupiter.api.Test;
23import org.pacien.lemonad.attempt.Attempt;
23 24
24import java.util.List; 25import java.util.List;
25import java.util.stream.Stream; 26import 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() {