///<summary> /// Creates a new bytecode Provider instance using the specified object factory ///</summary> ///<param name="listableObjectFactory"></param> public BytecodeProvider(IListableObjectFactory listableObjectFactory) { this.listableObjectFactory = listableObjectFactory; this.objectsFactory = new ObjectsFactory(listableObjectFactory); this.collectionTypefactory = new DefaultCollectionTypeFactory(); this.proxyFactoryFactory = new ProxyFactoryFactory(); }
/// <summary> /// Initializes a new instance of the <see cref="AutofacBytecodeProvider"/> class. /// </summary> /// <param name="container">The container.</param> /// <param name="proxyFactoryFactory">The proxy factory factory.</param> /// <param name="collectionTypeFactory">The collection type factory.</param> public AutofacBytecodeProvider(IComponentContext container, IProxyFactoryFactory proxyFactoryFactory, ICollectionTypeFactory collectionTypeFactory) { _container = container; _proxyFactoryFactory = proxyFactoryFactory; _collectionTypeFactory = collectionTypeFactory; _objectsFactory = new AutofacObjectsFactory(container); }
public void NotConfiguredProxyFactoryFactory() { var bcp = new BytecodeProviderImpl(); IProxyFactoryFactory p = bcp.ProxyFactoryFactory; Assert.That(p, Is.InstanceOf <DefaultProxyFactoryFactory>()); }
public void NotConfiguredProxyFactoryFactory() { var bcp = new BytecodeProviderImpl(); IProxyFactoryFactory p = bcp.ProxyFactoryFactory; p.Should().Be.InstanceOf <DefaultProxyFactoryFactory>(); }
public void CantCreateProxyFactoryFactory() { try { var bcp = new BytecodeProviderImpl(); bcp.SetProxyFactoryFactory(typeof(WrongProxyFactoryFactory).AssemblyQualifiedName); IProxyFactoryFactory p = bcp.ProxyFactoryFactory; Assert.Fail(); } catch (HibernateByteCodeException e) { Assert.That(e.Message, Is.StringStarting("Failed to create an instance of")); } }
public void NotConfiguredProxyFactoryFactory() { try { var bcp = new BytecodeProviderImpl(); IProxyFactoryFactory p = bcp.ProxyFactoryFactory; Assert.Fail(); } catch (HibernateByteCodeException e) { Assert.That(e.Message, Is.StringStarting("The ProxyFactoryFactory was not configured")); Assert.That(e.Message, Is.StringContaining("Example")); } }
/// <summary> /// TODO: /// </summary> /// <param name="listableObjectFactory"></param> public BytecodeProviderSrlzSupport(IListableObjectFactory listableObjectFactory) : base(listableObjectFactory) { this.proxyFactoryFactory = new ProxyFactoryFactorySrlzSupport(); }