Inheritance: N2.Persistence.Proxying.EmptyProxyFactory
Exemplo n.º 1
0
        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()));
        }
Exemplo 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) });
 }
Exemplo n.º 4
0
		public void TestFixtureSetUp()
		{
			factory = new InterceptingProxyFactory();
			var map = new DefinitionMap();
			factory.Initialize(new[] { typeof(InterceptableItem), typeof(InterceptableInheritorItem), typeof(IgnoringItem) }.Select(t => map.GetOrCreateDefinition(t)));
		}