protected override bool IsEligibleForProxying(Type objType, string name) { if (store.GetMetadataFor(objType) == null) { return(store.Add(objType)); } return(true); }
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(); }
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(); }
private bool ConfigureBasedOnAttributes(ComponentModel model) { return(metaStore.Add(model.Implementation)); }
public void AddProtection() { var store = new ReflectionConversationalMetaInfoStore(); Assert.Throws <ArgumentNullException>(() => store.Add(null)); }