コード例 #1
0
 protected override void CheckPermissionsToPark(Vehicle vehicle)
 {
     base.CheckPermissionsToPark(vehicle);
     if (carParkingSpaceValidator.IsVehicleSpaceInParkingLot())
     {
         ParkingSpaceInParkingLot = true;
     }
     if (carUniqueIdValidator.IsAValidId(vehicle.VehicleId))
     {
         IsVehicleValidId = true;
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }