public BookingQueryProcessorTests() { _unitOfWorkMock = new Mock <IUnitOfWork>(); _bookingList = new List <BookingEntity>(); _unitOfWorkMock.Setup(x => x.Query <BookingEntity>()) .Returns(() => _bookingList.AsQueryable()); _currentUserEntity = new UserEntity { Id = Guid.NewGuid() }; _securityContextMock = new Mock <ISecurityContext>(MockBehavior.Strict); _securityContextMock.Setup(x => x.UserEntity).Returns(_currentUserEntity); _securityContextMock.Setup(x => x.IsAdministrator).Returns(false); _securityContextMock.Setup(x => x.IsStaff).Returns(false); _bookingsQueryProcessor = new BookingsQueryProcessor(_unitOfWorkMock.Object, _securityContextMock.Object); }
public BookingsController(IBookingsQueryProcessor bookingsQuery, IAutoMapper mapper) { _bookingsQuery = bookingsQuery; _mapper = mapper; }