protected override void CheckPermissionsToPark(Vehicle vehicle)
 {
     base.CheckPermissionsToPark(vehicle);
     if (motorcycleParkingSpaceValidator.IsVehicleSpaceInParkingLot())
     {
         ParkingSpaceInParkingLot = true;
     }
     if (motorcycleUniqueIdValidator.IsAValidId(vehicle.VehicleId))
     {
         IsVehicleValidId = true;
     }
 }
예제 #2
0
        public void MotorcycleParkingLotHaveNoSpaceTest()
        {
            //Arrange
            var motorcyclesPakingLot = Mock.Create <IMotorcycleDao>();

            PopulateMotorcycleParkingLot(limitOfMotorcyclesParkingLot);
            Mock.Arrange(() => motorcyclesPakingLot.GetAllVehicles()).Returns(motorcycles);
            MotorcycleParkingSpaceValidator motorcycleParkingSpaceValidator = new MotorcycleParkingSpaceValidator(motorcyclesPakingLot);

            //Act
            bool isSpaceInParkingLot = motorcycleParkingSpaceValidator.IsVehicleSpaceInParkingLot();

            //Assert
            Assert.False(isSpaceInParkingLot);
        }
예제 #3
0
        public void MotorcycleParkingLotHaveSpaceTest()
        {
            //Arrange
            var motorcyclesPakingLot = Mock.Create <IMotorcycleDao>();

            motorcycles = new List <Motorcycle>();
            Mock.Arrange(() => motorcyclesPakingLot.GetAllVehicles()).Returns(motorcycles);
            MotorcycleParkingSpaceValidator motorcycleParkingSpaceValidator = new MotorcycleParkingSpaceValidator(motorcyclesPakingLot);

            //Act
            bool isSpaceInParkingLot = motorcycleParkingSpaceValidator.IsVehicleSpaceInParkingLot();

            //Assert
            Assert.True(isSpaceInParkingLot);
        }