package uk.ac.ebi.quickgo.rest.period;

import java.time.DayOfWeek;
import java.time.LocalTime;
import org.junit.Test;

/**
 * Test instantiation of the DayTime class.
 *
 * @author Tony Wardell
 * Date: 18/04/2017
 * Time: 10:43
 * Created with IntelliJ IDEA.
 */
public class DayTimeTest {

    @Test
    public void instantiateDayTimeWithValidValues(){
       new DayTime(DayOfWeek.FRIDAY, LocalTime.of(12, 37));
    }

    @Test(expected = IllegalArgumentException.class)
    public void nullDayOfWeekCreatesException(){
        new DayTime(null, LocalTime.of(12, 37));
    }

    @Test(expected = IllegalArgumentException.class)
    public void nullLocalTimeCreatesException(){
        new DayTime(DayOfWeek.FRIDAY, null);
    }
}

@@ -87,35 +87,219 @@
 ocal
-Time;%0Aimport org.junit.Test
+DateTime;%0Aimport java.time.LocalTime;%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.equalTo;%0Aimport static org.hamcrest.core.IsNull.notNullValue
 ;%0A%0A/
@@ -535,24 +535,47 @@
 es()%7B%0A      
+ DayTime validDayTime =
  new DayTime
@@ -607,32 +607,82 @@
 ime.of(12, 37));
+%0A%0A       assertThat(validDayTime, notNullValue());
 %0A    %7D%0A%0A    @Tes
@@ -983,11 +983,445 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void modify()%7B%0A        DayTime dayTime = new DayTime(DayOfWeek.FRIDAY, LocalTime.of(12, 37));%0A        LocalDateTime now = LocalDateTime.now();%0A        LocalDateTime compared = now.with(DayOfWeek.FRIDAY);%0A        LocalTime localTime = LocalTime.of(12, 37);%0A        compared = compared.with(localTime);%0A%0A        LocalDateTime modified = dayTime.modify(now);%0A%0A        assertThat(modified, equalTo(compared));%0A    %7D
 %0A%7D%0A

Add test case for instantiation successfully. Add test for modify();