Skip to content

Commit

Permalink
add test for duration and dtend properties
Browse files Browse the repository at this point in the history
  • Loading branch information
karakayasemi committed Oct 3, 2018
1 parent 1a80f30 commit aae2982
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
@@ -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
)
);
}
}
@@ -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
)
);
}
}

0 comments on commit aae2982

Please sign in to comment.