public void After_adding_attribute_must_be_listed_as_contained() { AttributesToAvoidReplicating.Add <string>(); bool contains = AttributesToAvoidReplicating.Contains(typeof(string)); Assert.IsTrue(contains); }
public void After_adding_attribute_must_still_contain_original_attributes() { AttributesToAvoidReplicating.Add <string>(); bool contains = AttributesToAvoidReplicating.Contains(typeof(System.Runtime.InteropServices.ComImportAttribute)); Assert.IsTrue(contains); }
private static T CreateServiceImpl(IInterceptor interceptor) { var serviceNamer = new ProxyNamer(new NamingScope(), typeof(T)); var generator = new ProxyGenerator(new DefaultProxyBuilder(new ModuleScope(false, false, serviceNamer, ModuleScope.DEFAULT_ASSEMBLY_NAME, ModuleScope.DEFAULT_FILE_NAME, ModuleScope.DEFAULT_ASSEMBLY_NAME, ModuleScope.DEFAULT_FILE_NAME))); AttributesToAvoidReplicating.Add <ServiceContractAttribute>(); AttributesToAvoidReplicating.Add <OperationContractAttribute>(); object proxy = generator.CreateInterfaceProxyWithoutTarget <T>(interceptor); return((T)proxy); }
public BaseTest() { AttributesToAvoidReplicating.Add <TypeIdentifierAttribute>(); chirp = new Chirp(); app = GetApp(); Array arr = null; chirp.OnConnection(app, ext_ConnectMode.ext_cm_AfterStartup, QuickMock <AddIn>(), ref arr); tasks = new TaskList(app); }
public static void AssemblyInit(TestContext context) { // Moq 4.0 Beta 3 (or rather the version of Castle DynamicProxy its using) has problems with some CAS attributes: // http://code.google.com/p/moq/issues/detail?id=250 // This should be fixed in the next version of Moq and this Assembly init code should not be needed. AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); // Initialize the Url Rewriter status cache to indicate that Url Rewriter is present HttpContextBase httpContext = PathHelpersTest.GetMockHttpContext(includeRewriterServerVar: false).Object; PathHelpers.GenerateClientUrl(httpContext, "index.html"); }
private static void ConfigureDynamicProxyToAvoidReplicatingProblematicAttributes() { #pragma warning disable 618 AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); #pragma warning restore 618 AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute>(); #if (NET4 || NET45) AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute>(); #endif AttributesToAvoidReplicating.Add <UIPermissionAttribute>(); }
static CastleProxyFactory() { #if FEATURE_CAS AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <UIPermissionAttribute>(); #endif #if FEATURE_COM AttributesToAvoidReplicating.Add <MarshalAsAttribute>(); AttributesToAvoidReplicating.Add <TypeIdentifierAttribute>(); #endif }
static CastleProxyFactory() { #pragma warning disable 618 AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); #pragma warning restore 618 #if !SILVERLIGHT AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute>(); #if !NET3x AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute>(); #endif #endif }
static DynamicAvatarFactory() { AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute>(); options = new ProxyGenerationOptions { Hook = new ObjectMethodsHook() }; #if DEBUG // This allows invoking generator.ProxyBuilder.ModuleScope.SaveAssembly() for troubleshooting. generator = new ProxyGenerator(new DefaultProxyBuilder(new ModuleScope(true))); #else generator = new ProxyGenerator(); #endif }
static DynamicProxyFactory() { AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute>(); proxyOptions = new ProxyGenerationOptions { Hook = new ProxyMethodHook() }; generator = new ProxyGenerator(); #if DEBUG // generator = new ProxyGenerator(new DefaultProxyBuilder(new ModuleScope(true))); #else // generator = new ProxyGenerator(); #endif }
private static void ConfigureDynamicProxyToAvoidReplicatingProblematicAttributes() { #pragma warning disable 618 AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); #pragma warning restore 618 AttributesToAvoidReplicating.Add <System.ServiceModel.ServiceContractAttribute>(); #if !SILVERLIGHT AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute>(); #if NET4 AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute>(); #endif #endif }
static ProxyFactory() { #pragma warning disable 618 AttributesToAvoidReplicating.Add <SecurityPermissionAttribute> (); #pragma warning restore 618 AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute> (); AttributesToAvoidReplicating.Add <PermissionSetAttribute> (); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute> (); AttributesToAvoidReplicating.Add <UIPermissionAttribute> (); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute> (); proxyOptions = new ProxyGenerationOptions { Hook = new ProxyMethodHook() }; generator = new ProxyGenerator(); }
static CastleProxyFactory() { #if FEATURE_CAS AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <UIPermissionAttribute>(); #endif #if FEATURE_COM AttributesToAvoidReplicating.Add <MarshalAsAttribute>(); AttributesToAvoidReplicating.Add <TypeIdentifierAttribute>(); #endif proxyOptions = new ProxyGenerationOptions { Hook = new IncludeObjectMethodsHook() }; }
static CastleProxyFactory() { #pragma warning disable 618 AttributesToAvoidReplicating.Add <SecurityPermissionAttribute>(); #pragma warning restore 618 #if !SILVERLIGHT AttributesToAvoidReplicating.Add <ReflectionPermissionAttribute>(); AttributesToAvoidReplicating.Add <PermissionSetAttribute>(); AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.MarshalAsAttribute>(); AttributesToAvoidReplicating.Add <UIPermissionAttribute>(); #if !NET3x AttributesToAvoidReplicating.Add <System.Runtime.InteropServices.TypeIdentifierAttribute>(); #endif #endif proxyOptions = new ProxyGenerationOptions { Hook = new ProxyMethodHook(), BaseTypeForInterfaceProxy = typeof(InterfaceProxy) }; }
public static void Initialize(TestContext context) { AttributesToAvoidReplicating.Add(typeof(ServiceContractAttribute)); }
static CastleDynamicProxyGenerator() { AttributesToAvoidReplicating.Add(typeof(SecurityPermissionAttribute)); }
protected ServiceAttributeBase() { IsInitialized.GetOrAdd(GetType(), t => { AttributesToAvoidReplicating.Add(t); return(default); });
static CastleDynamicProxyGenerator() { #pragma warning disable 618 AttributesToAvoidReplicating.Add(typeof(SecurityPermissionAttribute)); #pragma warning restore 618 }
public void MyTestInitialize() { AttributesToAvoidReplicating.Add(typeof(UIPermissionAttribute)); }