コード例 #1
0
 public void GetParameterReturnsNullForAnUnknownType()
 {
     var injector = new MethodParameterInjector(new object[] { "string", 5 });
     Assert.That(injector.GetParameter<ITestInterface>(), Is.Null);
 }
コード例 #2
0
 public void GetParameterReturnsTheDefaultForAnUnknownValueType()
 {
     var injector = new MethodParameterInjector(new object[] { "string", 5 });
     Assert.That(injector.GetParameter<DateTime>(), Is.EqualTo(default(DateTime)));
 }
コード例 #3
0
        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));
        }