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")); }
public void FindSubstituteFor_DriverNull_ReturnsNull() { _handler = new TypeSubstitutionHandler(null); var sub = _handler.FindSubstituteFor(typeof(string)); Assert.That(sub, Is.Null); }