Exemple #1
0
        public void Exit_ThrowsException_Exit_CallBayManager_ForFeeIsNotPaid()
        {
            // Arrange
            var vehicle = Substitute.For <IVehicle>();

            vehicle.IsFeePaid.Returns(false);
            CarPark sut = CreateSut();

            // Act
            // Assert
            Assert.Throws <CarDidNotPayFeeException>(() => sut.Exit(vehicle));
        }
Exemple #2
0
        public void Exit_CallBayManager_ForFeeIsPaid()
        {
            // Arrange
            var vehicle = Substitute.For <IVehicle>();

            vehicle.IsFeePaid.Returns(true);
            CarPark sut = CreateSut();

            // Act
            sut.Exit(vehicle);

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