@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorDuration() throws Exception { new Conference("", "", null); }
@Override protected Conference createInstance() { return new Conference("", "", new Duration(new Date(), new Date())); }
@Override protected Conference createDomainObject() { return new Conference("Name", "TagLine", new Duration(new Date(), new Date())); }
@Test(expected = UnsupportedOperationException.class) public void shouldNotAllowToAddSessionToSessions() throws Exception { Conference conf = new Conference("", "", new Duration(new Date(), new Date())); Session sess = new Session("", "", new Duration(new Date(), new Date())); conf.getSessions().add(sess); } }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorName() throws Exception { new Conference(null, "", new Duration(new Date(), new Date())); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullConstructorTagline() throws Exception { new Conference("", null, new Duration(new Date(), new Date())); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowToAddNullSession() throws Exception { Conference conf = new Conference("", "", new Duration(new Date(), new Date())); conf.addSession(null); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullSetterTagLine() throws Exception { Conference conf = new Conference("", "", new Duration(new Date(), new Date())); conf.setTagLine(null); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullSetterDuration() throws Exception { Conference conf = new Conference("", "", new Duration(new Date(), new Date())); conf.setDuration(null); }
@Test(expected = IllegalArgumentException.class) public void shouldNotAllowNullSetterName() throws Exception { Conference conf = new Conference("", "", new Duration(new Date(), new Date())); conf.setName(null); }
@Override public Conference to(UriInfo uriInfo, ConferenceRepresentation representation) { Conference conf = new Conference( representation.getName(), representation.getTagLine(), new Duration(representation.getStart(), representation.getEnd())); return conf; }
public static Conference createConference() { Conference conference = new Conference( "Devoxx Belgium 2013", "We Code In Peace", new Duration(toDate(2013, 11, 11), toDate(2013, 11, 15))); return conference; }