public void should_success_to_stop_car() { Park park = new Park(1); Car car = new Car("JP123"); ParkingManager manager = new ParkingManager(new List<Park> { park }, null); manager.StopCar(car); Assert.Same(car, park.PickUpCar(car.CarNumber)); }
public void should_success_to_ask_parkingboy_to_stop_car_when_one_boy() { Park park = new Park(1); Car car = new Car("JP123"); ParkingBoy parkingBoy = new ParkingBoy(park); ParkingManager manager = new ParkingManager(null, new List<ParkingBoyBase> { parkingBoy }); manager.StopCar(car); Assert.Same(car, park.PickUpCar(car.CarNumber)); }
public void when_manager_have_one_full_parking() { ParkingManager manager = new ParkingManager(new List<Park> { new Park(1) }, null); manager.StopCar(new Car("JP123")); ParkingDirector director = new ParkingDirector(manager); string report = director.GenerateReport(); string[] array = report.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); Assert.Equal(string.Format("{0}P 0 1", Utils.SpaceTwo), array[1]); Assert.Equal("M 0 1", array[0]); }
public void should_success_to_ask_parkingboy_to_pick_car_when_two_boys() { ParkingBoy parkingBoy = new ParkingBoy(new Park(1)); SmartParkingBoy smartParkingBoy = new SmartParkingBoy(new Park(1)); Car car = new Car("JP123"); ParkingManager manager = new ParkingManager(null, new List<ParkingBoyBase> { parkingBoy, smartParkingBoy }); manager.StopCar(car); Assert.Same(car, manager.PickUpCar(car.CarNumber)); }
public void should_success_to_stop_car_when_manager_full_and_boys_empty() { ParkingBoy parkingBoy = new ParkingBoy(new Park(1)); ParkingManager manager = new ParkingManager( new List<Park> { new Park(0) }, new List<ParkingBoyBase> { parkingBoy }); Car car = new Car("JP123"); manager.StopCar(car); Assert.Same(car, manager.PickUpCar(car.CarNumber)); }