Пример #1
0
        public void should_throw_exception_if_passenger_argument_of_enter_passenger_method_is_null()
        {
            var smartFortwo = new SmartFortwo();

            var exception = Assert.Throws <Exception>(() => smartFortwo.EnterPassenger(null));

            Assert.Equal("Its not possible to enter a null passenger in the smart fortwo", exception.Message);
        }
Пример #2
0
        public void should_enter_passenger()
        {
            var smartFortwo = new SmartFortwo();
            var passenger   = new Pilot("passenger");

            smartFortwo.EnterPassenger(passenger);

            Assert.Equal(passenger, smartFortwo.Passenger);
        }
Пример #3
0
        public void Should_disembark_passenger_from_smart_fortwo_and_return_it()
        {
            var smartFortwo = new SmartFortwo();
            var passenger   = new Officer("passenger name");

            smartFortwo.EnterPassenger(passenger);

            var place = new PlaceMock();

            place.SetSmartFortwo(smartFortwo);

            var returnedCrewMember = place.DisembarkPassengerFromSmartFortwo();

            Assert.Null(place.SmartFortwo.Passenger);
            Assert.Equal(passenger, returnedCrewMember);
        }
Пример #4
0
        public void should_disembark_passenger_from_the_smart_fortwo()
        {
            var passenger   = new Pilot("pilot");
            var smartFortwo = new SmartFortwo();

            smartFortwo.EnterPassenger(passenger);

            var destinyPlace = new Airplane();

            destinyPlace.SetSmartFortwo(smartFortwo);

            var returnedPassenger = smartFortwo.DisembarkPassenger();

            Assert.Null(smartFortwo.Driver);
            Assert.Equal(passenger, returnedPassenger);
        }