コード例 #1
0
        public void If_there_is_only_one_instance_of_a_type_use_that_as_default()
        {
            var target = new AFoo();

            var container = new Container(registry => registry.For <IFoo>().Use(target));

            container.GetInstance <IFoo>()
            .ShouldBeTheSameAs(target);
        }
コード例 #2
0
 public BarFromIBar(AFoo foo)
 {
     this.foo = foo;
 }
        public void AttemptToAbstractClassCreation()
        {
            SimpleContainer c = new SimpleContainer();

            Assert.ThrowsException <ArgumentException>(() => { AFoo foo = c.Resolve <AFoo>(); });
        }