コード例 #1
0
        public void Should_throws_exception_when_try_to_put_driver_in_a_null_smart_fortwo()
        {
            var place     = new PlaceMock();
            var exception = Assert.Throws <Exception>(() => place.PutDriverInSmartFortwo(new Officer("name")));

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

            place.SetSmartFortwo(new SmartFortwo());

            var driver = new Pilot("pilot name");

            place.PutDriverInSmartFortwo(driver);

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