コード例 #1
0
        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);
        }
コード例 #2
0
 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));
     }
 }