public void Usage_DelegatedToFunc()
        {
            var config = new MyLibrary().BindToContainer(Activator.CreateInstance);

            var instance = config.Create();

            Assert.That(instance, Is.Not.Null);
        }
        public void Usage_ConcreteImplementation()
        {
            var config = new MyLibrary().BindToContainer(new ActivatorCreationStrategy());

            var instance = config.Create();

            Assert.That(instance, Is.Not.Null);
        }
        public void Usage_DefaultStrategy()
        {
            var config = new MyLibrary();

            var instance = config.Create();

            Assert.That(instance, Is.Not.Null);
        }
        public void Usage_DelegatedToFunc()
        {
            var config = new MyLibrary().BindToContainer(Activator.CreateInstance);

            var instance = config.Create();

            Assert.That(instance, Is.Not.Null);
        }
        public void UsageFailure_StrategyNulled()
        {
            var config = new MyLibrary {
                TypeCreationStrategy = null
            };

            Assert.Throws <NullReferenceException>(() => config.Create());
        }
        public void Usage_DefaultStrategy()
        {
            var config = new MyLibrary();

            var instance = config.Create();

            Assert.That(instance, Is.Not.Null);
        }
        public void Usage_ConcreteImplementation()
        {
            var config = new MyLibrary().BindToContainer(new ActivatorCreationStrategy());

            var instance = config.Create();

            Assert.That(instance, Is.Not.Null);
        }
        public void UsageFailure_StrategyNulled()
        {
            var config = new MyLibrary {TypeCreationStrategy = null};

            Assert.Throws<NullReferenceException>(() => config.Create());
        }