Example #1
0
        public void ClassWithConstructorParameterNotResolvable()
        {
            SimpleContainer c = new SimpleContainer();

            Assert.ThrowsException <ArgumentException>(() =>
            {
                ClassWithStringField a = c.Resolve <ClassWithStringField>();
            });
        }
Example #2
0
        public void ClassWithConstructorParameterCreatedBefore()
        {
            SimpleContainer c = new SimpleContainer();

            string s = "abc";

            c.RegisterInstance <string>(s);

            ClassWithStringField a = c.Resolve <ClassWithStringField>();

            Assert.AreEqual(a.s, s);
        }