コード例 #1
0
        public void Should_throws_exception_when_try_to_disembark_driver_if_smart_fortwo_is_null()
        {
            var place     = new PlaceMock();
            var exception = Assert.Throws <Exception>(() => place.DisembarkDriverFromSmartFortwo());

            Assert.Equal($"{place.GetType().Name} does not have a smart fortwo", exception.Message);
        }
コード例 #2
0
        public void Should_disembark_driver_from_smart_fortwo_and_return_it()
        {
            var smartFortwo = new SmartFortwo();
            var driver      = new Officer("driver name");

            smartFortwo.EnterDriver(driver);

            var place = new PlaceMock();

            place.SetSmartFortwo(smartFortwo);

            var returnedCrewMember = place.DisembarkDriverFromSmartFortwo();

            Assert.Null(place.SmartFortwo.Driver);
            Assert.Equal(driver, returnedCrewMember);
        }