private void assertScopeLeadsToInterceptor(string scope, Type interceptorType)
        {
            var att = new PluginFamilyAttribute();
            att.Scope = scope;

            var family = new PluginFamily(typeof (TypeThatDoesNotHaveCustomMementoSource));
            att.Configure(family);

            family.Lifecycle.ShouldBeOfType(interceptorType);
        }
        private void assertScopeLeadsToInterceptor(InstanceScope scope, Type interceptorType)
        {
            var att = new PluginFamilyAttribute("something");

            att.Scope = scope;

            var family = new PluginFamily(typeof(TypeThatDoesNotHaveCustomMementoSource));

            att.Configure(family);

            Assert.IsInstanceOfType(interceptorType, family.Lifecycle);
        }
        public void PerRequest_DoesNot_call_SetScopeTo_on_family()
        {
            var att = new PluginFamilyAttribute("something");
            att.Scope = InstanceScope.PerRequest;

            var mocks = new MockRepository();
            var family = mocks.DynamicMock<IPluginFamily>();

            using (mocks.Record())
            {
                family.SetScopeTo(InstanceScope.PerRequest);
                LastCall.Repeat.Never();
            }

            using (mocks.Playback())
            {
                att.Configure(family);
            }
        }
        public void PerRequest_DoesNot_call_SetScopeTo_on_family()
        {
            var att = new PluginFamilyAttribute("something");

            att.Scope = InstanceScope.PerRequest;

            var mocks  = new MockRepository();
            var family = mocks.DynamicMock <IPluginFamily>();

            using (mocks.Record())
            {
                family.SetScopeTo(InstanceScope.PerRequest);
                LastCall.Repeat.Never();
            }

            using (mocks.Playback())
            {
                att.Configure(family);
            }
        }
        private void assertScopeLeadsToInterceptor(InstanceScope scope, Type interceptorType)
        {
            var att = new PluginFamilyAttribute("something");
            att.Scope = scope;

            var family = new PluginFamily(typeof (TypeThatDoesNotHaveCustomMementoSource));
            att.Configure(family);

            Assert.IsInstanceOfType(interceptorType, family.Lifecycle);
        }