示例#1
0
        public void FindByRegNumber_NotSucceed()
        {
            // Arrange

            var garageCreator = new GarageCreator();
            var garageHandler = new GarageHandler();
            var garage        = garageHandler.CreateGarage(1);

            garageHandler.ParkCar(garage, "abc123", "white", 4, 2000, "Diseal", 1);


            // Act

            Vehicle vehicle = garageCreator.FindByRegNumber(garage, "SWW023");

            // Assert

            Assert.IsNull(vehicle);
        }
示例#2
0
        public void FindByRegNumber_Succeed()
        {
            // Arrange

            var garageCreator = new GarageCreator();
            var garageHandler = new GarageHandler();
            var garage        = garageHandler.CreateGarage(1);
            Car expectedCar   = new Car("SWW023", "white", 4, 2000, "Diseal", 1);

            garageHandler.ParkCar(garage, "SWW023", "white", 4, 2000, "Diseal", 1);


            // Act

            Vehicle vehicle = garageCreator.FindByRegNumber(garage, "SWW023");


            // Assert
            // Find Car
            Assert.AreEqual(expectedCar.RegisteringNumber, vehicle.RegisteringNumber);
            Assert.AreEqual(expectedCar.Color, vehicle.Color);
            Assert.AreEqual(expectedCar.NoWheel, vehicle.NoWheel);
        }