Beispiel #1
0
        public void GivenAEntersTheCarPark(string vehicleTypeString)
        {
            IVehicle vehicle = CreateVehicle(vehicleTypeString,
                                             DoesNotMatterWeight);

            ScenarioContext.Current [vehicleTypeString] = vehicle;

            CarPark.Enter(vehicle);
        }
Beispiel #2
0
        public void GivenAWithAWeightOfKgsEntersTheCarPark(string vehicleTypeString,
                                                           int weightInKilogram)
        {
            IVehicle vehicle = CreateVehicle(vehicleTypeString,
                                             weightInKilogram);

            ScenarioContext.Current [vehicleTypeString] = vehicle;

            CarPark.Enter(vehicle);
        }
Beispiel #3
0
        public void Enter_ThrowsException_ForCarParkIsFull()
        {
            // Arrange
            var vehicle = Substitute.For <IVehicle>();

            m_BayManager.IsFull.Returns(true);
            CarPark sut = CreateSut();

            // Act
            // Assert
            Assert.Throws <CarParkIsFullException>(() => sut.Enter(vehicle));
        }
Beispiel #4
0
        public void Enter_CallBayManager_ForCarParkIsNotFull()
        {
            // Arrange
            var vehicle = Substitute.For <IVehicle>();

            m_BayManager.IsFull.Returns(false);
            CarPark sut = CreateSut();

            // Act
            sut.Enter(vehicle);

            // Assert
            m_BayManager.Received().AssignBay(vehicle);
        }