Exemple #1
0
        public void CanInjectSameMethodSeveralTimes()
        {
            ObjectWithOverloadedInjectionMethod obj =
                ResolveConfiguredObject <ObjectWithOverloadedInjectionMethod>("method-multi");

            Assert.AreEqual(3, obj.initializationParameters.Count);
            Assert.AreEqual("contoso", obj.initializationParameters[0]);
            Assert.AreEqual("northwind", obj.initializationParameters[1]);
            Assert.AreEqual("AdventureWorks", obj.initializationParameters[2]);
        }
Exemple #2
0
        public void CanInjectOverloads()
        {
            ObjectWithOverloadedInjectionMethod obj =
                ResolveConfiguredObject <ObjectWithOverloadedInjectionMethod>("method-overload");

            Assert.AreEqual(4, obj.initializationParameters.Count);
            Assert.AreEqual("contoso", (string)obj.initializationParameters[0]);
            Assert.AreEqual(14, (int)obj.initializationParameters[1]);
            Assert.AreEqual("AdventureWorks", (string)obj.initializationParameters[2]);
            Assert.AreEqual(42, (int)obj.initializationParameters[3]);
        }