public async Task Get_All_Slots_Successes() { Setup(); var slots = GenerateListOfSlots(); var slotsContract = GenerateListOfSlotsContract(); _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.TakeAllSlots(); var actual = result.ToList(); var i = 0; foreach (var expectedContract in slotsContract) { var dur = expectedContract.Duration; Assert.Equal(expectedContract.Id, actual[i].Id); Assert.Equal(expectedContract.CoachId, actual[i].CoachId); Assert.Equal(expectedContract.TimeStart, actual[i].TimeStart); Assert.Equal(expectedContract.DateStart, actual[i].DateStart); i++; } }
public AdminSlotsController(IUserService userService, IStringLocalizer <AdminSlotsController> localizer, ILogger <AdminSlotsController> logger, ISlotService slotService) : base("~/Views/AdminSlots.cshtml", userService) { _localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _slotService = slotService ?? throw new ArgumentNullException(nameof(slotService)); }
private void Setup() { var options = new DbContextOptionsBuilder <ApplicationContext>().Options; _applicationContextMock = new Mock <ApplicationContext>(options); _testedService = new SlotService(Logger, _applicationContextMock.Object); }
public async Task Create_Slots_Successes() { Setup(); var slots = GenerateListOfSlots(); var firstSlot = new SlotsReturnContract() { CoachId = 5, DateStart = "02.20.2001", TimeStart = "11:00" }; var SecondSlot = new SlotsReturnContract() { CoachId = 5, DateStart = "02.20.2001", TimeStart = "10:00" }; List <SlotsReturnContract> slotsAdd = new List <SlotsReturnContract>() { firstSlot, SecondSlot }; _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.AddListOfSlots(slotsAdd, CancellationToken.None); Assert.True(result); }
public OrderController(IOrderService orderService, ISlotService slotService, ICustomerService customerService, IShipperService shipperService, IOrderSService orderServiceService) { _orderService = orderService; _slotService = slotService; _customerService = customerService; _shipperService = shipperService; _orderServiceService = orderServiceService; }
public SlotController( IAsyncRepository <Slot> slotRepository, ISlotService slotService, IMapper mapper) : base(mapper) { _slotRepository = slotRepository; _slotService = slotService; }
public ScoreboardController(IUserService userService, IStringLocalizer <ScoreboardController> localizer, IScoreboardService scoreboardService, ILabService labService, ISlotService slotService) : base("~/Views/Scoreboard.cshtml", userService) { _localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); _scoreboardService = scoreboardService ?? throw new ArgumentNullException(nameof(scoreboardService)); _labService = labService ?? throw new ArgumentNullException(nameof(labService)); _slotService = slotService ?? throw new ArgumentNullException(nameof(slotService)); }
public HomeController(IUserService userService, IScheduleService scheduleService, ISlotService slotService, ITaskService taskService, IColumnService columnService, IUserActivityService userActivityService) { _userService = userService; _scheduleService = scheduleService; _slotService = slotService; _taskService = taskService; _columnService = columnService; _userActivityService = userActivityService; }
public SlotsViewModel(ISlotService slotService, IEventAggregator eventAggregator) { _slotService = slotService; _eventAggregator = eventAggregator; _eventAggregator.GetEvent <RefreshDataEvent>().Subscribe(refreshView); slotList = new ObservableCollection <Slot>(); view = (CollectionView)CollectionViewSource.GetDefaultView(slotList); SendReservation = new RelayCommand(OnSendReservationClick, CanClick); }
public AstreintesController(ISlotService service, ISlotRepository repository, IValidation <Slot> slotValidation, IValidation <User> userValidation, EFContext efContext, IMapper <Slot, SlotUI> slotMapper) { slotService = service; slotRepository = repository; this.slotValidation = slotValidation; this.userValidation = userValidation; context = efContext; mapper = slotMapper; }
public AdminViewModel(IEventAggregator eventAggregator, ISlotService slotService) { _eventAggregator = eventAggregator; _slotService = slotService; _eventAggregator.GetEvent <RefreshDataEvent>().Subscribe(refreshView); allSlotList = new ObservableCollection <Slot>(); view = (CollectionView)CollectionViewSource.GetDefaultView(allSlotList); ClearReservation = new RelayCommand(OnClearReservationClick, CanClick); }
public AuthenticationController(IUserService userService, IStringLocalizer <AuthenticationController> localizer, ILogger <AuthenticationController> logger, ISlotService slotService, IConfigurationService configurationService, IWebHostEnvironment webHostEnvironment, IServiceProvider serviceProvider) : base("~/Views/Authentication.cshtml", userService) { _userService = userService ?? throw new ArgumentNullException(nameof(userService)); _localizer = localizer ?? throw new ArgumentNullException(nameof(localizer)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _slotService = slotService ?? throw new ArgumentNullException(nameof(slotService)); _configurationService = configurationService ?? throw new ArgumentNullException(nameof(configurationService)); _webHostEnvironment = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment)); _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); }
public OrderController(IOrderService orderService, ISlotService slotService, ICustomerService customerService, IShipperService shipperService, IOrderSService orderServiceService, IServiceService serviceService, IStoreService storeService, IHubContext <CenterHub> hub) { _orderService = orderService; _slotService = slotService; _customerService = customerService; _shipperService = shipperService; _orderServiceService = orderServiceService; _serviceService = serviceService; _storeService = storeService; _hub = hub; }
public SlotsController( ArtaplanContext context, IMapper mapper, ISlotService slotService, IStageService stageService ) { _mapper = mapper; _context = context; _slotService = slotService; _stageService = stageService; }
public async Task Get_Count_Slots_Successes() { Setup(); var slots = GenerateListOfSlots(); _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.TakeAllSlots(); Assert.Equal(slots.Count(), result.Count()); }
public async Task Create_Slots_Failed() { Setup(); var slots = GenerateListOfSlots(); var EmptyList = new List <SlotsReturnContract>(); _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.AddListOfSlots(EmptyList, CancellationToken.None); Assert.False(result); }
public async Task Slots_Remove_Failed_Null() { Setup(); var slots = GenerateListOfSlots(); var EmptyList = new List <int>(); _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.RemoveSlotRange(EmptyList, CancellationToken.None); Assert.False(result); }
public async Task Slots_Remove_Successes(int id) { Setup(); var slots = GenerateListOfSlots(); var ByOneList = new List <int>() { id }; _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.RemoveSlotRange(ByOneList, CancellationToken.None); Assert.True(result); }
public async Task Slots_Update_Successes(int id) { Setup(); var slots = GenerateListOfSlots(); var firstSlot = new SlotsReturnContract() { Id = id, CoachId = 5, DateStart = "02.20.2001", Duration = "10:00", TimeStart = "11:00" }; _applicationContextMock.Setup(x => x.Slots).ReturnsDbSet(slots); _testedService = new SlotService(Logger, _applicationContextMock.Object); var result = await _testedService.UpdateSlot(firstSlot, CancellationToken.None); Assert.True(result); }
public BookingController(IBookingService bookingService, ISlotService slotService) { _bookingService = bookingService; _slotService = slotService; }
public SlotApiController(ISlotService slotService) { this._slotService = slotService; }
public SlotController(ISlotService slotService, IUserService userService, IRoomService roomService) { _slotService = slotService; _userService = userService; _roomService = roomService; }
public SlotController(IShipperService shipperService, ISlotService slotService, IOrderService orderService) { _shipperService = shipperService; _slotService = slotService; _orderService = orderService; }
public SlotController(ISlotService slotService, IBookingService bookingService) { _slotService = slotService; _bookingService = bookingService; }
public SlotController(ISlotService slotService) { _slotService = slotService; }
public ParkingAssistantController(ISlotService recommendedSlotProvider) { _recommendedSlotProvider = recommendedSlotProvider; }
public SlotController(ISlotService slotService, IUrlHelper urlHelper) { _slotService = slotService; _urlHelper = urlHelper; }
public void Setup() { _slotRepository = MockRepository.GenerateStub<ISlotRepository>(); _slotService = new SlotService(_slotRepository); _urlHelper = MockRepository.GenerateStub<IUrlHelper>(); _objectUnderTest = new SlotController(_slotService, _urlHelper); _objectUnderTest.Request = new HttpRequestMessage(); _objectUnderTest.Request.SetConfiguration(new HttpConfiguration()); }
public SlotController(ISlotService slotService) { _slotService = slotService ?? throw new ArgumentNullException(nameof(slotService)); }
public SlotController(ISlotService slotService, IMapper mapper) { SlotService = slotService; Mapper = mapper; }
public SlotController(ISlotService slotService, IMasterService masterService) { this.slotService = slotService; _masterService = masterService; }
public SlotController(ISlotService slots) { Slots = slots; }