Пример #1
0
        public void GetValue_ReturnsItemFullPath()
        {
            //Assign
            var param = new ItemIdNoBracketsParameter();
            var item  = Database.GetItem("/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemIdNoBracketsParameter");

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

            //Assert
            Assert.AreEqual("3E61E999FED643E09D128B19D60D8A13".ToLower(), result);
        }
        public void GetValue_ReturnsItemIdAsString()
        {
            //Assign
            ItemIdNoBracketsParameter param = new ItemIdNoBracketsParameter();

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

            //Assert
            string idResult = _item.ID.Guid.ToString("N");

            Assert.AreEqual(idResult, result);
            Guid idGuid;

            Assert.IsTrue(result.GuidTryParse(out idGuid));
        }
Пример #3
0
        public void GetValue_ReturnsItemFullPath()
        {
            using (Db database = new Db
            {
                new Sitecore.FakeDb.DbItem("Target")
            })
            {
                //Assign
                var param = new ItemIdNoBracketsParameter();
                var item  =
                    database.GetItem(
                        "/sitecore/content/Target");

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

                //Assert
                Assert.AreEqual(item.ID.Guid.ToString("N").ToLower(), result);
            }
        }