Example #1
0
        public void EventController_GetAll(
            [Frozen] IEventQueryables eventQueryables,
            EventController eventController,
            IEnumerable <EventDto> @event)
        {
            //Information
            A.CallTo(() => eventQueryables.GetAll()).Returns(@event);

            //Act
            eventController.GetAll();

            //Test
            A.CallTo(() => eventQueryables.GetAll())
            .MustHaveHappenedOnceExactly();
        }
Example #2
0
        public void EventController_GetUserRegistrated(
            [Frozen] IEventQueryables eventQueryables,
            EventController eventController,
            Guid userId,
            IEnumerable <EventDto> @event)
        {
            //Information
            A.CallTo(() => eventQueryables.GetUsersRegistered(userId)).Returns(@event);

            //Act
            eventController.GetUserRegistrated(userId);

            //Test
            A.CallTo(() => eventQueryables.GetUsersRegistered(userId))
            .MustHaveHappenedOnceExactly();
        }
Example #3
0
        public void EventController_GetAllUserCreatedEvents(
            [Frozen] IEventQueryables eventQueryables,
            EventController eventController,
            Guid userId,
            IEnumerable <EventDto> @event)
        {
            //Information
            A.CallTo(() => eventQueryables.GetByUser(userId)).Returns(@event);

            //Act
            eventController.GetAllUserCreatedEvents(userId);

            //Test
            A.CallTo(() => eventQueryables.GetByUser(userId))
            .MustHaveHappened();
        }
Example #4
0
        public void EventController_GetById(
            [Frozen] IEventQueryables eventQueryables,
            EventController eventController,
            Guid userId,
            EventDto @event)
        {
            @event.EventID = userId;
            //Information
            A.CallTo(() => eventQueryables.GetById(userId)).Returns(@event);

            //Act
            eventController.GetById(userId);

            //Test
            A.CallTo(() => eventQueryables.GetById(userId))
            .MustHaveHappenedOnceExactly();
        }
Example #5
0
 public EventController
 (
     IUnitOfWork unitOfWork,
     IEventQueryables eventQueryables,
     ICommandHandler <CreateEventCommand> createEventCommandHandler,
     ICommandHandler <UpdateEventCommand> updateEventCommandHandler,
     ICommandHandler <DeleteEventCommand> deleteEventCommandHandler,
     ICommandHandler <RegisterUserOnEventCommand> registerUserOnEventCommand,
     ICommandHandler <UnRegisterUserOnEventCommand> unRegisterUserOnEventCommand
 )
 {
     _createEventCommandHandler    = createEventCommandHandler;
     _updateEventCommandHandler    = updateEventCommandHandler;
     _deleteEventCommandHandler    = deleteEventCommandHandler;
     _registerUserOnEventCommand   = registerUserOnEventCommand;
     _unRegisterUserOnEventCommand = unRegisterUserOnEventCommand;
     _eventQueryables = eventQueryables;
     _unitOfWork      = unitOfWork;
 }
Example #6
0
 public UpdateEventCommandHandler(IEventRepository eventRepository, IEventQueryables eventQueryables)
 {
     _eventRepository = eventRepository;
     _eventQueryables = eventQueryables;
 }