public void InsertMotorbike_DuplicateMotorbike_ShouldNotInsertTheMotorbike() { var motorbike = new Motorbike("CA1011AH", "John Smith", 1); this.park.InsertMotorbike(motorbike, 1, 1, new DateTime(2015, 5, 10, 10, 30, 0)); var motorbike2 = new Motorbike("CA1011AH", "Sarah Smith", 1); var message = this.park.InsertMotorbike(motorbike2, 1, 2, new DateTime(2015, 5, 10, 10, 30, 0)); Assert.AreEqual("There is already a vehicle with license plate CA1011AH in the park", message); }
public void InsertMotorbike_DuplicatePlace_ShouldNotInsertTheMotorbike() { var motorbike = new Motorbike("CA1011AH", "John Smith", 1); this.park.InsertMotorbike(motorbike, 1, 1, new DateTime(2015, 5, 10, 10, 30, 0)); var motorbike2 = new Motorbike("CA1010AH", "Sarah Smith", 1); var message = this.park.InsertMotorbike(motorbike2, 1, 1, new DateTime(2015, 5, 10, 10, 30, 0)); Assert.AreEqual("The place (1,1) is occupied", message); }
public void InsertMotorbike_CorrectParameters_ShouldInsertTheMotorbike() { var motorbike = new Motorbike("CA1011AH", "John Smith", 1); var message = this.park.InsertMotorbike(motorbike, 1, 1, new DateTime(2015, 5, 10, 10, 30, 0)); Assert.AreEqual("Motorbike parked successfully at place (1,1)", message); var motorbike2 = new Motorbike("CA1010AH", "Sarah Smith", 1); message = this.park.InsertMotorbike(motorbike2, 1, 2, new DateTime(2015, 5, 10, 10, 30, 0)); Assert.AreEqual("Motorbike parked successfully at place (1,2)", message); }
public void InitializeTest() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; this.park = new VehiclePark(2, 2); var car = new Car("CA1011AH", "John Smith", 1); this.park.InsertCar(car, 1, 1, new DateTime(2015, 5, 10, 10, 30, 0)); var truck = new Truck("CA1010AH", "Sarah Smith", 1); this.park.InsertTruck(truck, 1, 2, new DateTime(2015, 5, 10, 10, 30, 0)); var motorbike = new Motorbike("CA1012AH", "Linda Smith", 1); this.park.InsertMotorbike(motorbike, 2, 1, new DateTime(2015, 5, 10, 10, 30, 0)); var car2 = new Car("CA1013AH", "Linda Cloe", 1); this.park.InsertCar(car2, 2, 2, new DateTime(2015, 5, 10, 10, 30, 0)); }
public void InsertMotorbike_WrongSector_ShouldNotInsertTheMotorbike() { var motorbike = new Motorbike("CA1011AH", "John Smith", 1); var message = this.park.InsertMotorbike(motorbike, 3, 1, new DateTime(2015, 5, 10, 10, 30, 0)); Assert.AreEqual("There is no sector 3 in the park", message); }
public string InsertMotorbike(Motorbike motorbike, int numberOfSector, int placesInSector, DateTime startTime) { return this.InsertVehicle(motorbike, numberOfSector, placesInSector, startTime); }