コード例 #1
0
        public void GetValue_ReturnsItemFullPath()
        {
            //Assign
            var param = new ItemEscapedPathParameter();
            var item = Database.GetItem("/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemEscapedPathParameter");

            //Act
            var result = param.GetValue(item);

            //Assert
            Assert.AreEqual("/#sitecore#/#content#/#Tests#/#DataMappers#/#SitecoreQueryParameters#/#ItemEscapedPathParameter#", result);
        }
コード例 #2
0
        public void GetValue_ReturnsItemFullPath()
        {
            //Assign
            using (Db database = new Db
            {
                new Sitecore.FakeDb.DbItem("Target")
            })
            {
                var param = new ItemEscapedPathParameter();
                var item =
                    database.GetItem(
                        "/sitecore/content/Target");

                //Act
                var result = param.GetValue(item);

                //Assert
                Assert.AreEqual(
                    "/#sitecore#/#content#/#Target#",
                    result);
            }
        }