Exemplo n.º 1
0
		public override void TestFixtureSetUp()
		{
			base.TestFixtureSetUp();

			persister = (ContentPersister) engine.Resolve<IPersister>();
			versioner = (VersionManager) engine.Resolve<IVersionManager>();
		}
Exemplo n.º 2
0
        public void AncestralTrail_IsUpdated_WhenUsing_VersioningManager()
        {
            PersistableItem1 root = CreateOneItem<PersistableItem1>(0, "root", null);
            PersistableItem1 one = CreateOneItem<PersistableItem1>(0, "one", root);
            persister.Save(root);

            N2.Persistence.VersionManager vm = new VersionManager(persister.Repository, finder, new N2.Edit.Workflow.StateChanger(), new N2.Configuration.EditSection());
            var version = vm.SaveVersion(one);

            one.Name += "2";
            persister.Save(one);

            Assert.That(version.AncestralTrail, Is.EqualTo("/"));
            Assert.That(one.AncestralTrail, Is.EqualTo("/" + root.ID + "/"));
        }
Exemplo n.º 3
0
 public FakeVersionManager(FakeRepository<ContentItem> itemRepository, StateChanger stateChanger)
 {
     this.itemRepository = itemRepository;
     original = new VersionManager(itemRepository, null, stateChanger);
 }