public void TesT22() { var root = new ItemRecord { ID = ItemIDs.RootItemID, Name = "Sitecore" }; var namesCache = new ChildrenDataSet(new ItemDefinitions(root)); // act Guid id; var result = ItemPathResolver.TryResolvePath("/sitecore/", namesCache, out id); Assert.IsTrue(result); Assert.AreEqual(root.ID, id); }
public void TesT4() { var root = new ItemRecord { ID = ItemIDs.RootItemID, Name = "Sitecore" }; var content = new ItemRecord { ID = Guid.NewGuid(), Name = "content", ParentID = root.ID }; var namesCache = new ChildrenDataSet(new ItemDefinitions(root, content)); // act Guid id; var result = ItemPathResolver.TryResolvePath("/sitecore/system", namesCache, out id); Assert.IsFalse(result); Assert.AreEqual(root.ID, id); }
public void TesT5() { var root = new ItemRecord { ID = ItemIDs.RootItemID, Name = "Sitecore" }; var content1 = new ItemRecord { ID = Guid.NewGuid(), Name = "content", ParentID = root.ID }; var content2 = new ItemRecord { ID = Guid.NewGuid(), Name = "content", ParentID = root.ID }; var home = new ItemRecord { ID = Guid.NewGuid(), Name = "Home", ParentID = content2.ID }; var namesCache = new ChildrenDataSet(new ItemDefinitions(root, content1, content2, home)); // act Guid id; var result = ItemPathResolver.TryResolvePath("/sitecore/content/home", namesCache, out id); Assert.IsTrue(result); Assert.AreEqual(home.ID, id); }
protected AmpItemResolver(BaseItemManager itemManager, ItemPathResolver pathResolver, MixedItemNameResolvingMode itemNameResolvingMode) : base(itemManager, pathResolver, itemNameResolvingMode) { }
public AmpItemResolver(BaseItemManager itemManager, ItemPathResolver pathResolver) : base(itemManager, pathResolver, Settings.ItemResolving.FindBestMatch) { }