public void ShouldAssignSameSizedSpotWhenAvailable(Size size) { var testParkingLot = GetFakeParkingLot(); //Fake lot with 5 slots in each type. var testVehicle = GetFakeVehicle(size); var expectedSpot = new ParkingSpot { OccupiedVehicle = testVehicle, SpotSize = testVehicle.VehicleSize }; _svc = new ParkingLotManager.ParkingLot(testParkingLot, _searchService.Object); switch (size) { case Size.Hatchback: _searchService.Setup(x => x.Search(testParkingLot, Size.Hatchback)).Returns(expectedSpot); break; case Size.Sedan: _searchService.Setup(x => x.Search(testParkingLot, Size.Sedan)).Returns(expectedSpot); break; case Size.Truck: _searchService.Setup(x => x.Search(testParkingLot, Size.Truck)).Returns(expectedSpot); break; } ParkingSpot result = _svc.AssignParkingSpot(testVehicle); Assert.AreEqual(result.SpotSize, expectedSpot.SpotSize); Assert.AreEqual(result.OccupiedVehicle, expectedSpot.OccupiedVehicle); }
public void ShouldSayParkingFullWhenHatchbackisAvailablButSedanAndTruckAreUnavailable(Size size) { var testParkingLot = GetFakeParkingLot(); //Fake lot with 5 slots in each type. var testVehicle = GetFakeVehicle(size); _svc = new ParkingLotManager.ParkingLot(testParkingLot, _searchService.Object); switch (size) { case Size.Sedan: _searchService.Setup(x => x.Search(testParkingLot, Size.Sedan)).Returns((ParkingSpot)null); _searchService.Setup(x => x.Search(testParkingLot, Size.Truck)).Returns((ParkingSpot)null); break; case Size.Truck: _searchService.Setup(x => x.Search(testParkingLot, Size.Truck)).Returns((ParkingSpot)null); break; } ParkingSpot result = _svc.AssignParkingSpot(testVehicle); Assert.AreEqual(result, null); }
public ParkingLotController(IParkingLotService parkingLotService, IUserService userService, IHostingEnvironment hostingEnvironment) { _parkingLotService = parkingLotService; _userService = userService; _hostingEnvironment = hostingEnvironment; _path = Path.Combine(_hostingEnvironment.WebRootPath, "Images", "ParkingLot"); }
public VehicleRegistrationService(IRepository <Data.Vehicle> vehicleRepository, IRepository <Data.PromotionCard> promotionCardRepository, IRepository <Data.VehicleCategory> vehicleCategoryRepository, IParkingLotService parkingLotService) { this.vehicleRepository = vehicleRepository; this.promotionCardRepository = promotionCardRepository; this.vehicleCategoryRepository = vehicleCategoryRepository; this.parkingLotService = parkingLotService; }
public void ShouldAssignTruckSpotWhenHatchBackAndSedanIsUnavailable() { var testParkingLot = GetFakeParkingLot(); //Fake lot with 5 slots in each type. var testVehicle = GetFakeVehicle(Size.Hatchback); var expectedSpot = new ParkingSpot { OccupiedVehicle = testVehicle, SpotSize = Size.Truck }; _svc = new ParkingLotManager.ParkingLot(testParkingLot, _searchService.Object); _searchService.Setup(x => x.Search(testParkingLot, Size.Hatchback)).Returns((ParkingSpot)null); _searchService.Setup(x => x.Search(testParkingLot, Size.Sedan)).Returns((ParkingSpot)null); _searchService.Setup(x => x.Search(testParkingLot, Size.Truck)).Returns(expectedSpot); ParkingSpot result = _svc.AssignParkingSpot(testVehicle); Assert.AreEqual(result.SpotSize, expectedSpot.SpotSize); Assert.AreEqual(result.OccupiedVehicle, expectedSpot.OccupiedVehicle); }
public ParkingLotsController(IParkingLotService parkingLotService) { this.parkingLotService = parkingLotService; }
public ParkingLotController(IParkingLotService parkingLotService, IParkingFloorService parkingFloorService) { this.parkingLotService = parkingLotService; this.parkingFloorService = parkingFloorService; }
/// <summary> /// Initializes a new instance of the <see cref="SecurityController"/> class. /// </summary> /// <param name="service">IparkinglotService object.</param> public SecurityController(IParkingLotService service) { this.service = service; }
/// <summary> /// Initializes a new instance of the <see cref="PoliceController"/> class. /// </summary> /// <param name="service">service.</param> public PoliceController(IParkingLotService service) { this.service = service; }
public ParkingLotsController(Mapper mapper, IParkingLotService service) { this.mapper = mapper; this.service = service; }
/// <summary> /// Initializes a new instance of the <see cref="DriverController"/> class. /// </summary> /// <param name="service">IparkinglotService object.</param> public DriverController(IParkingLotService service) { this.service = service; }
public AllocationService(ParkSharkDbContext context, IMemberService memberService, IParkingLotService parkingLotService) { this.context = context; this.memberService = memberService; this.parkingLotService = parkingLotService; }
public Menu(IParkingLotService parkingLotService) { _parkingLotService = parkingLotService; }
public ParkingLotsController(IParkingLotMapper parkingLotMapper, IParkingLotService parkingLotService) { _parkingLotMapper = parkingLotMapper; _parkingLotService = parkingLotService; }
public OrdersController(IOrderService orderService, IParkingLotService parkingLotService) { this.orderService = orderService; this.parkingLotService = parkingLotService; }
public ParkingLotController(ILogger <ParkingLotController> logger, IParkingLotService parkingLotService) { this.logger = logger; this.parkingLotService = parkingLotService; }