Example #1
0
        public void Should_check_whether_smart_fortwo_has_driver_and_throw_exception_if_it_is_null()
        {
            var place     = new PlaceMock();
            var exception = Assert.Throws <Exception>(() => place.SmartFortwoHasDriver());

            Assert.Equal($"{place.GetType().Name} does not have a smart fortwo", exception.Message);
        }
Example #2
0
        public void Should_check_whether_smart_fortwo_has_driver_and_return_false_if_it_doesnt_have()
        {
            var place = new PlaceMock();

            place.SetSmartFortwo(new SmartFortwo());

            var hasDriver = place.SmartFortwoHasDriver();

            Assert.False(hasDriver);
        }
Example #3
0
        public void Should_check_whether_smart_fortwo_has_driver_and_return_true_if_it_has()
        {
            var smartFortwo = new SmartFortwo();
            var driver      = new Pilot("driver name");

            smartFortwo.EnterDriver(driver);

            var place = new PlaceMock();

            place.SetSmartFortwo(smartFortwo);

            var hasDriver = place.SmartFortwoHasDriver();

            Assert.True(hasDriver);
        }