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(); }
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(); }
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(); }
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(); }
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; }
public UpdateEventCommandHandler(IEventRepository eventRepository, IEventQueryables eventQueryables) { _eventRepository = eventRepository; _eventQueryables = eventQueryables; }