protected override void CheckPermissionsToPark(Vehicle vehicle) { base.CheckPermissionsToPark(vehicle); if (motorcycleParkingSpaceValidator.IsVehicleSpaceInParkingLot()) { ParkingSpaceInParkingLot = true; } if (motorcycleUniqueIdValidator.IsAValidId(vehicle.VehicleId)) { IsVehicleValidId = true; } }
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); }
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); }