public void ParkCar_ShouldBeOk() { Car car = new Car("make", "32131"); Car car1 = new Car("mazarate", "CB4444BB"); SoftPark parking = new SoftPark(); parking.ParkCar("A1", car); parking.ParkCar("A2", car1); var parked = new Dictionary <string, Car> { { "A1", car }, { "A2", car1 }, { "A3", null }, { "A4", null }, { "B1", null }, { "B2", null }, { "B3", null }, { "B4", null }, { "C1", null }, { "C2", null }, { "C3", null }, { "C4", null }, }; Assert.AreEqual(parked, parking.Parking); }
public void TestParkCarMethodShouldThrowExcetionIfParkSpotIsInvalid() { SoftPark softPark = new SoftPark(); Car car = new Car("Audi", "123123"); Assert.Throws <ArgumentException>(() => softPark.ParkCar("1", car)); }
public void TestParkingOnNonExistantSpot() { SoftPark parking = new SoftPark(); Car car = new Car("VW", "CA2249PC"); Assert.Throws <ArgumentException>(() => parking.ParkCar("A5", car), "Parking spot doesn't exists!"); }
public void TestIfConstructorWorksCorrectly() { SoftPark park = new SoftPark(); int expectedCount = 12; Assert.AreEqual(expectedCount, park.Parking.Count); }
public void Parking_Spot_Doesnt_Exists_Throw() { var park = new SoftPark(); Car car = new Car("Ford", "CA 8484"); Assert.Throws <ArgumentException>((() => park.ParkCar("A0", car))); }
public void ParkingSpotIsTakenAlready() { SoftPark park = new SoftPark(); park.ParkCar("A1", this.car); Assert.Throws <ArgumentException>(() => park.ParkCar("A1", new Car("Make", "CA234")), "Parking spot is already taken!"); }
public void Remove_Car_Throws_Parked_Car_Doesnt_Exist_Exception() { Car car = new Car("Audi", "A8"); var softPark = new SoftPark(); Assert.Throws <ArgumentException>(() => softPark.RemoveCar("C3", car)); }
public void ParkCarThrowsArgumentExceptionIfParkingSpotDoesNotExist() { SoftPark softPark = new SoftPark(); Car car = new Car("a", "123"); Assert.That(() => softPark.ParkCar("a", car), Throws.ArgumentException); }
public void TestCarIsAlreadyParked() { SoftPark parking = new SoftPark(); parking.ParkCar("A1", this.car); Assert.Throws <InvalidOperationException>(() => parking.ParkCar("A2", this.car), "Car is already parked!"); }
public void Test_Park_Car_Throw_Exception_For_Invalid_Parking_Spot() { Car car = new Car("Audi", "A8"); var softPark = new SoftPark(); Assert.Throws <ArgumentException>(() => softPark.ParkCar("C5", car)); }
public void SoftParkConstructorWorksProperly() { SoftPark softPark = new SoftPark(); int expectedCarCount = 12; Assert.That(softPark.Parking.Count, Is.EqualTo(expectedCarCount), "SoftPark constructor made too many or not enough cars."); }
public void Test4() { SoftPark softPark = new SoftPark(); Assert.Throws <ArgumentException>( () => softPark.RemoveCar("G1", new Car("vw", "1234"))); }
public void RemoveCar_ShouldRemoveCar() { Car car = new Car("maare", "31232"); SoftPark parking = new SoftPark(); parking.ParkCar("A1", car); parking.RemoveCar("A1", car); var parked = new Dictionary <string, Car> { { "A1", null }, { "A2", null }, { "A3", null }, { "A4", null }, { "B1", null }, { "B2", null }, { "B3", null }, { "B4", null }, { "C1", null }, { "C2", null }, { "C3", null }, { "C4", null }, }; Assert.AreEqual(parked, parking.Parking); }
public void TestIfNonExistingSpotThrowsException() { SoftPark softPark = new SoftPark(); Assert.Throws <ArgumentException>( () => softPark.ParkCar("G1", null)); }
public void Constructor_Work_Correctly() { var park = new SoftPark(); var actualCount = park.Parking.Count; Assert.AreEqual(12, actualCount); }
public void TestRemoveCarMethodShouldThrowsException() { Car car = new Car("Audi", "8596"); SoftPark softpark = new SoftPark(); Assert.Throws <ArgumentException>(() => softpark.RemoveCar("Volkswagen", car)); }
public void TestIfParkedCarreturnMessageWithRegistrationNum() { var softPark = new SoftPark(); string parkSpot = "C4"; Car car = new Car("MyCar", "123456"); Assert.AreEqual(softPark.ParkCar(parkSpot, car), $"Car:123456 parked successfully!"); }
public void TestCollectionCount() { SoftPark softPark = new SoftPark(); int parkingCount = softPark.Parking.Count; int count = 12; Assert.AreEqual(count, parkingCount); }
public void TestRemovingACarFromNonexistantSpot() { SoftPark parking = new SoftPark(); Car car = new Car("VW", "CA2249PC"); Assert.Throws <ArgumentException>(() => parking.RemoveCar("A15", car), "Parking spot doesn't exists!"); }
public void TestRemoveNonExistingCarOnSpot() { SoftPark softPark = new SoftPark(); Car current = new Car("Bently", "975"); softPark.ParkCar("A1", new Car("Lada", "293746")); Assert.Throws <ArgumentException>(() => softPark.RemoveCar("A1", current), "Car for that spot doesn't exists!"); }
public void TestWhenParkingSpotDoesntExit() { var softPark = new SoftPark(); string parkSpot = "C5"; Car car = new Car("MyCar", "123456"); Assert.Throws <ArgumentException>(() => softPark.RemoveCar(parkSpot, car)); }
public void Parking_Count_Works_Correctly() { var softPark = new SoftPark(); var expected = 12; var actual = softPark.Parking.Count; Assert.AreEqual(expected, actual); }
public void ParkCar_ShouldThrowExceptioneSameCar() { Car car = new Car("make", "32131"); SoftPark parking = new SoftPark(); parking.ParkCar("A1", car); Assert.Throws <InvalidOperationException>(() => parking.ParkCar("A2", car)); }
public void ParkCar_ShouldThrowException() { Car car = new Car("make", "32131"); SoftPark parking = new SoftPark(); parking.ParkCar("A1", car); Assert.Throws <ArgumentException>(() => parking.ParkCar("A1", new Car("make", "321321"))); }
public void Test3() { SoftPark softPark = new SoftPark(); Car car = new Car("vw", "1234"); string expected = $"Car:{car.RegistrationNumber} parked successfully!"; string actual = softPark.ParkCar("A1", car); Assert.AreEqual(expected, actual); }
public void Park_Car_Work_Correctly() { var park = new SoftPark(); Car car = new Car("Ford", "CA 8484"); var result = park.ParkCar("A1", car); Assert.AreEqual("Car:CA 8484 parked successfully!", result); }
public void Test_Park_Car_Throw_Exception_For_Parked_Car() { Car car = new Car("Audi", "A8"); var softPark = new SoftPark(); softPark.ParkCar("C4", car); Assert.Throws <InvalidOperationException>(() => softPark.ParkCar("C3", car)); }
public void Car_Is_Already_Parked_Throw() { var park = new SoftPark(); Car car = new Car("Ford", "CA 8484"); park.ParkCar("A1", car); Assert.Throws <InvalidOperationException>(() => park.ParkCar("B1", car)); }
public void ParkCarShouldThrowExceptionWithInvalidCarSpot() { var car = new Car("BMW", "2215"); var parking = new SoftPark(); Assert.Throws <ArgumentException>(() => parking.ParkCar("z11", car)); }
public void Remove_Invalid_Car_From_Spot_Throw() { var park = new SoftPark(); Car car = new Car("Ford", "CA 8484"); park.ParkCar("A1", car); Assert.Throws <ArgumentException>(() => park.RemoveCar("A2", car)); }