From 11a6ff02601d9fd04544d6cd96dec99b26464d40 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 29 Mar 2019 16:30:32 +0100 Subject: add missing method test --- src/test/java/org/pacien/lemonad/validation/ValidationTest.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/test/java/org/pacien') 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; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; +import org.pacien.lemonad.attempt.Attempt; import java.util.List; import java.util.stream.Stream; @@ -41,6 +42,7 @@ class ValidationTest { assertFalse(validation.isInvalid()); validation.ifValid(innerSubject -> assertEquals(subject, innerSubject)); validation.ifInvalid((__, ___) -> fail()); + assertEquals(Attempt.success(subject), validation.toAttempt()); } @Test void testInvalidResult() { @@ -55,6 +57,7 @@ class ValidationTest { assertEquals(subject, innerSubject); assertEquals(errors, innerErrors); }); + assertEquals(Attempt.failure(errors), validation.toAttempt()); } @Test void testFlatMap() { -- cgit v1.2.3