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

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

            place.SetSmartFortwo(new SmartFortwo());

            var passenger = new Prisoner("passenger name");
            var driver    = new Policeman("pilot name");

            place.PutBothInSmartFortwo(driver, passenger);

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