예제 #1
0
        public void FindSubstituteFor_GivenTypeWithSub_SubReturned()
        {
            _fakeDriver.Substitutes.Add(new DriverBindings.TypeSubstitution(typeof(string), () => "hi"));
            var propertyType = typeof(string);

            var substitute = _handler.FindSubstituteFor(propertyType);

            Assert.That(substitute, Is.TypeOf <DriverBindings.TypeSubstitution>());
            Assert.That(substitute.GetInstance(), Is.EqualTo("hi"));
        }
예제 #2
0
        public void FindSubstituteFor_DriverNull_ReturnsNull()
        {
            _handler = new TypeSubstitutionHandler(null);

            var sub = _handler.FindSubstituteFor(typeof(string));

            Assert.That(sub, Is.Null);
        }