///<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();
 }
예제 #2
0
 /// <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);
 }
예제 #3
0
 /// <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);
 }
예제 #4
0
        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>();
        }
예제 #6
0
 ///<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();
 }
예제 #7
0
 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"));
     }
 }
예제 #8
0
 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();
 }