public void ShouldAddConversational()
        {
            var store = new ReflectionConversationalMetaInfoStore();

            store.Add(typeof(SillyCrudModel));
            IConversationalMetaInfoHolder metainfo = store.GetMetadataFor(typeof(SillyCrudModel));

            metainfo.Should().Not.Be.Null();
            metainfo.ConversationalClass.Should().Be.EqualTo(typeof(SillyCrudModel));
            metainfo.Methods.Should().Not.Be.Empty();
        }
        public override void ProcessModel(IKernel kernel, ComponentModel model)
        {
            if (metaStore == null)
            {
                metaStore = (ReflectionConversationalMetaInfoStore)kernel.Resolve(typeof(IConversationalMetaInfoStore));
            }

            if (!ConfigureBasedOnAttributes(model))
            {
                return;
            }
            Validate(model, metaStore);

            AddConversationInterceptorIfIsConversational(model, metaStore);
        }
        public void ShouldWorkWithInherited()
        {
            var store = new ReflectionConversationalMetaInfoStore();

            store.Add(typeof(SillyCrudModel));
            store.Add(typeof(InheritedSillyCrudModelWithConcreteConversationCreationInterceptor));

            store.MetaData.Count().Should().Be.EqualTo(2);

            IConversationalMetaInfoHolder metainfo =
                store.GetMetadataFor(typeof(InheritedSillyCrudModelWithConcreteConversationCreationInterceptor));

            metainfo.Should().Not.Be.Null();
            metainfo.ConversationalClass.Should().Be.EqualTo(
                typeof(InheritedSillyCrudModelWithConcreteConversationCreationInterceptor));
            metainfo.Methods.Should().Not.Be.Empty();
        }
Example #4
0
 public ConversationalAttributeAutoProxyCreator(IConversationalMetaInfoStore store)
 {
     this.store = (ReflectionConversationalMetaInfoStore)store;
 }
        public void AddProtection()
        {
            var store = new ReflectionConversationalMetaInfoStore();

            Assert.Throws <ArgumentNullException>(() => store.Add(null));
        }