public void DTOConverterShouldConvert() { IEvent @event = SetUpEvent(); EventDTO eventDTO = SetUpEventDTO(); DTOConverter dTOConverter = new DTOConverter(new EventFactory(), new InvitationFactory()); IEvent convertedEvent = dTOConverter.DTOToEvent(eventDTO); Assert.Equal(eventDTO.Name, @event.Name); Assert.Equal(eventDTO.Description, @event.Description); }
public ActionResult Post(EventDTO eventDto) { if (eventDto != null) { DTOConverter dTOConverter = new DTOConverter(_eventFactory, _invitationFactory); IEvent @event = dTOConverter.DTOToEvent(eventDto); return(StatusCode(200)); } else { return(StatusCode(500)); } }