コード例 #1
0
        public void ShouldResolvePath(string path, ResolvePathCommand sut, DbItem item)
        {
            item.FullPath = "/sitecore/content/home";
            sut.DataStorage.GetFakeItems().Returns(new[] { item });
            sut.Initialize(path);

            ReflectionUtil.CallMethod(sut, "DoExecute").Should().Be(item.ID);
        }
コード例 #2
0
        public void ShouldResolveFirstItemId(ResolvePathCommand sut, DbItem item1, DbItem item2)
        {
            const string path = "/sitecore/content/home";

            item1.FullPath = path;
            item2.FullPath = path;
            sut.DataStorage.GetFakeItems().Returns(new[] { item1, item2 });
            sut.Initialize(path);

            ReflectionUtil.CallMethod(sut, "DoExecute").Should().Be(item1.ID);
        }
コード例 #3
0
 public void ShouldReturnIdIfPathIsId(ResolvePathCommand sut, ID itemId)
 {
     sut.Initialize(itemId.ToString());
     ReflectionUtil.CallMethod(sut, "DoExecute").Should().Be(itemId);
 }
コード例 #4
0
 public void ShouldReturnNullIfNoItemFound(ResolvePathCommand sut, string path)
 {
     sut.Initialize(path);
     ReflectionUtil.CallMethod(sut, "DoExecute").Should().BeNull();
 }