public void GetParameterReturnsNullForAnUnknownType() { var injector = new MethodParameterInjector(new object[] { "string", 5 }); Assert.That(injector.GetParameter<ITestInterface>(), Is.Null); }
public void GetParameterReturnsTheDefaultForAnUnknownValueType() { var injector = new MethodParameterInjector(new object[] { "string", 5 }); Assert.That(injector.GetParameter<DateTime>(), Is.EqualTo(default(DateTime))); }
public void GetParameterReturnsAnInstanceMatchingTheTypeRequested() { var testImpl = new TestImpl(); var injector = new MethodParameterInjector(new object[] { "string", 5 }); injector.AddInstance<ITestInterface>(testImpl); Assert.That(injector.GetParameter<ITestInterface>(), Is.SameAs(testImpl)); }