protected override void CheckPermissionsToPark(Vehicle vehicle) { base.CheckPermissionsToPark(vehicle); if (carParkingSpaceValidator.IsVehicleSpaceInParkingLot()) { ParkingSpaceInParkingLot = true; } if (carUniqueIdValidator.IsAValidId(vehicle.VehicleId)) { IsVehicleValidId = true; } }
public void CarsParkingLotHaveNoSpaceTest() { //Arrange var carsPakingLot = Mock.Create <ICarDao>(); PopulateCarsParkingLot(limitOfCarsParkingLot); Mock.Arrange(() => carsPakingLot.GetAllVehicles()).Returns(cars); CarParkingSpaceValidator carParkingSpaceValidator = new CarParkingSpaceValidator(carsPakingLot); //Act bool isSpaceInParkingLot = carParkingSpaceValidator.IsVehicleSpaceInParkingLot(); //Assert Assert.False(isSpaceInParkingLot); }
public void CarsParkingLotHaveSpaceTest() { //Arrange var carsPakingLot = Mock.Create <ICarDao>(); cars = new List <Car>(); Mock.Arrange(() => carsPakingLot.GetAllVehicles()).Returns(cars); CarParkingSpaceValidator carParkingSpaceValidator = new CarParkingSpaceValidator(carsPakingLot); //Act bool isSpaceInParkingLot = carParkingSpaceValidator.IsVehicleSpaceInParkingLot(); //Assert Assert.True(isSpaceInParkingLot); }