Inheritance: N2.Persistence.Proxying.EmptyProxyFactory
        public virtual void TestFixtureSetup()
        {
            IDefinitionProvider[] definitionProviders;
            fs = new FakeMemoryFileSystem();
            TestSupport.Setup(out definitionProviders, out definitions, out activator, out notifier, out proxyFactory, persistedTypes);

            //var definitionProviders = TestSupport.SetupDefinitionProviders(new DefinitionMap(), typeof(PersistableItem), typeof(NonVirtualItem), typeof(PersistablePart));
            var proxies = new InterceptingProxyFactory();
            proxies.Initialize(definitionProviders.SelectMany(dp => dp.GetDefinitions()));
        }
Esempio n. 2
0
        public void ExportedImportedItem_AutoGeneratedProperties_AreImported()
        {
            var item = definitions.CreateInstance <XmlableItem2>(null);

            item.AutoPropertyString = "Hello World!";

            // simulate saving proxied items - this is most likely the case in normal operation
            var pf  = new N2.Persistence.Proxying.InterceptingProxyFactory();
            var map = new DefinitionMap();

            pf.Initialize(new [] { map.GetOrCreateDefinition(typeof(XmlableItem2)) });
            pf.OnSaving(item);

            var readItem = ExportAndImport(item, ExportOptions.Default);

            Assert.That(readItem.AutoPropertyString, Is.EqualTo(item.AutoPropertyString));
        }
 public void TestFixtureSetUp()
 {
     factory = new InterceptingProxyFactory();
     factory.Initialize(new[] { typeof(InterceptableItem), typeof(InterceptableInheritorItem), typeof(IgnoringItem) });
 }
		public void TestFixtureSetUp()
		{
			factory = new InterceptingProxyFactory();
			var map = new DefinitionMap();
			factory.Initialize(new[] { typeof(InterceptableItem), typeof(InterceptableInheritorItem), typeof(IgnoringItem) }.Select(t => map.GetOrCreateDefinition(t)));
		}