public void ActivatingAProvidedInstanceTwice_RaisesException()
        {
            object instance = new object();

            ProvidedInstanceActivator target =
                new ProvidedInstanceActivator(instance);

            target.ActivateInstance(Factory.EmptyContainer, Factory.NoParameters);

            Assert.Throws <InvalidOperationException>(() =>
                                                      target.ActivateInstance(Factory.EmptyContainer, Factory.NoParameters));
        }
Beispiel #2
0
        public void WhenInitializedWithInstance_ThatInstanceIsReturnedFromActivateInstance()
        {
            object instance = new object();

            ProvidedInstanceActivator target = new ProvidedInstanceActivator(instance);

            var actual = target.ActivateInstance(Factory.EmptyContainer, Factory.NoParameters);

            Assert.AreSame(instance, actual);
        }