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 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 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_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 TestParkingTheSameCarAtDifferentPlace() { SoftPark parking = new SoftPark(); Car car = new Car("VW", "CA2249PC"); parking.ParkCar("A1", car); Assert.Throws <InvalidOperationException>(() => parking.ParkCar("A2", car), "Car is already parked!"); }
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 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 ParkingCar_ShouldParkCar() { string slot = "A1"; Car car = new Car("bmw", "69"); string actualMessage = soft.ParkCar(slot, car); string expectedMessage = $"Car:{car.RegistrationNumber} parked successfully!"; Assert.AreEqual(expectedMessage, actualMessage); }
public void TestIfCarIsAlreadyParked() { SoftPark softPark = new SoftPark(); Car car = new Car("VW", "1234"); softPark.ParkCar("A1", car); Assert.Throws <InvalidOperationException>( () => softPark.ParkCar("A2", car)); }
public void TestIfParkingSpotIsTaken() { SoftPark softPark = new SoftPark(); Car car = new Car("Honda", "1234"); softPark.ParkCar("A1", car); Assert.Throws <ArgumentException>( () => softPark.ParkCar("A1", car)); }
public void TestParkingOnAlreadyTakenSpot() { SoftPark parking = new SoftPark(); Car car = new Car("VW", "CA2249PC"); Car newCar = new Car("VW", "CA0000AC"); parking.ParkCar("A1", car); Assert.Throws <ArgumentException>(() => parking.ParkCar("A1", newCar), "Parking spot is already taken!"); }
public void ThrowInvalidOperationExceptionWhenTheCarIsAlreadyParked() { var softPark = new SoftPark(); string parkSpot = "C4"; Car car = new Car("MyCar", "123456"); softPark.ParkCar(parkSpot, car); Assert.Throws <InvalidOperationException>(() => softPark.ParkCar("C2", car)); }
public void Parking_Spot_Is_Already_Taken_Throw() { var park = new SoftPark(); Car car = new Car("Ford", "CA 8484"); Car secondCar = new Car("Opel", "CB 8484"); park.ParkCar("A1", car); Assert.Throws <ArgumentException>(() => park.ParkCar("A1", secondCar)); }
public void TestParkCarMethodShouldThrowExcetionIfParkSpotIsNotNull() { SoftPark softPark = new SoftPark(); Car car = new Car("Audi", "123123"); Car car2 = new Car("AudiQ", "123123"); softPark.ParkCar("A1", car); Assert.Throws <ArgumentException>(() => softPark.ParkCar("A1", car2)); }
public void Test_Park_Car_Throw_Exception_For_Taken_Parking_Spot() { Car car = new Car("Audi", "A8"); var softPark = new SoftPark(); softPark.ParkCar("C4", car); Car anotherCar = new Car("BMW", "X6"); Assert.Throws <ArgumentException>(() => softPark.ParkCar("C4", anotherCar)); }
public void FUKINGTEST() { SoftPark softPark = new SoftPark(); var car = new Car("BMW", "ABC123"); softPark.ParkCar("A1", car); Assert.Throws <InvalidOperationException>( () => softPark.ParkCar("B1", car)); }
public void ThrowArgumentExceptionWhenParkingSpotIsAlreadytaken() { var softPark = new SoftPark(); string parkSpot = "C4"; Car carAlreadyParked = new Car("MyParkedCar", "1234567"); softPark.ParkCar(parkSpot, carAlreadyParked); Car car = new Car("OtherCar", "1234"); Assert.Throws <ArgumentException>(() => softPark.ParkCar(parkSpot, car)); }
public void ParkCarShouldThrowExceptionIfRegistrationNumberIsAlreadyExist() { var car = new Car("BMW", "2215"); var car2 = new Car("Audi", "2215"); var parking = new SoftPark(); parking.ParkCar("A1", car); Assert.Throws <InvalidOperationException>(() => parking.ParkCar("A2", car2)); }
public void ParkCarShouldThrowExceptionIfCarSpotIsNotEmpty() { var car = new Car("BMW", "2215"); var car2 = new Car("Audi", "5115"); var parking = new SoftPark(); parking.ParkCar("A1", car); Assert.Throws <ArgumentException>(() => parking.ParkCar("A1", car2)); }
public void ParkTheSameCar() { SoftPark park = new SoftPark(); Car car = new Car("Audi", "1234"); string parkSpotOne = "A3"; string parkSpotTwo = "A1"; park.ParkCar(parkSpotOne, car); Assert.Throws <InvalidOperationException>(() => { park.ParkCar(parkSpotTwo, car); }); }
public void ParkingSpotAlreadyTaken() { SoftPark park = new SoftPark(); Car carOne = new Car("Audi", "1234"); Car carTwo = new Car("BMW", "2345"); string parkSpot = "A3"; park.ParkCar(parkSpot, carOne); Assert.Throws <ArgumentException>(() => { park.ParkCar(parkSpot, carTwo); }); }
public void TestIfParkCarCommandWorksCorrectly() { Car car = new Car("VW", "1157"); parking.ParkCar("A1", car); Assert.NotNull(parking.Parking["A1"]); }
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 TestIfNonExistingSpotThrowsException() { SoftPark softPark = new SoftPark(); Assert.Throws <ArgumentException>( () => softPark.ParkCar("G1", null)); }
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 ParkCarThrowsArgumentExceptionIfParkingSpotDoesNotExist() { SoftPark softPark = new SoftPark(); Car car = new Car("a", "123"); Assert.That(() => softPark.ParkCar("a", car), Throws.ArgumentException); }
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 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 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!"); }