diff --git a/src/test/java/tr/edu/itu/cavabunga/lib/entity/property/DtendTest.java b/src/test/java/tr/edu/itu/cavabunga/lib/entity/property/DtendTest.java new file mode 100644 index 0000000..de125ca --- /dev/null +++ b/src/test/java/tr/edu/itu/cavabunga/lib/entity/property/DtendTest.java @@ -0,0 +1,36 @@ +package tr.edu.itu.cavabunga.lib.entity.property; + +import org.junit.jupiter.params.provider.Arguments; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; +import tr.edu.itu.cavabunga.lib.exception.Validation; + +import java.util.stream.Stream; + +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; + +@RunWith(JUnitPlatform.class) +class DtendTest extends PropertyTest { + + private static Stream invalidInputProvider() { + // TODO: 10/2/2018 test with non-mock object + Dtend dtend1 = mock(Dtend.class); + doThrow(Validation.class).when(dtend1).validate(); + return Stream.of( + Arguments.of( + dtend1 + ) + ); + } + + private static Stream validInputProvider() { + Dtend dtend1 = new Dtend(); + dtend1.setValue("20100212T235900"); + return Stream.of( + Arguments.of( + dtend1 + ) + ); + } +} diff --git a/src/test/java/tr/edu/itu/cavabunga/lib/entity/property/DurationTest.java b/src/test/java/tr/edu/itu/cavabunga/lib/entity/property/DurationTest.java new file mode 100644 index 0000000..5c521ce --- /dev/null +++ b/src/test/java/tr/edu/itu/cavabunga/lib/entity/property/DurationTest.java @@ -0,0 +1,36 @@ +package tr.edu.itu.cavabunga.lib.entity.property; + +import org.junit.jupiter.params.provider.Arguments; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; +import tr.edu.itu.cavabunga.lib.exception.Validation; + +import java.util.stream.Stream; + +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; + +@RunWith(JUnitPlatform.class) +class DurationTest extends PropertyTest { + + private static Stream invalidInputProvider() { + // TODO: 10/2/2018 test with non-mock object + Duration duration1 = mock(Duration.class); + doThrow(Validation.class).when(duration1).validate(); + return Stream.of( + Arguments.of( + duration1 + ) + ); + } + + private static Stream validInputProvider() { + Duration duration1 = new Duration(); + duration1.setValue("P15DT5H0M20S"); + return Stream.of( + Arguments.of( + duration1 + ) + ); + } +}