Exemplo n.º 1
0
        public void GetValue_ReturnsItemFullPath()
        {
            //Assign
            var param = new ItemIdParameter();
            var item  = Database.GetItem("/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemIdParameter");

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

            //Assert
            Assert.AreEqual("{DF486E14-EE4D-472A-BD8C-8BBD4C468A2D}", result);
        }
        public void GetValue_ReturnsItemIdAsString()
        {
            //Assign
            ItemIdParameter param = new ItemIdParameter();

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

            //Assert
            Assert.AreEqual(_item.ID.ToString(), result);
            Guid idGuid;
            Assert.IsTrue(result.GuidTryParse(out idGuid));
        }
Exemplo n.º 3
0
        public void GetValue_ReturnsItemIdAsString()
        {
            //Assign
            ItemIdParameter param = new ItemIdParameter();

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

            //Assert
            Assert.AreEqual(_item.ID.ToString(), result);
            Guid idGuid;

            Assert.IsTrue(result.GuidTryParse(out idGuid));
        }
        public void GetValue_ReturnsItemFullPath()
        {
            //Assign
            using (Db database = new Db
            {
                new Sitecore.FakeDb.DbItem("Target")
            })
            {
                var param = new ItemIdParameter();
                var item  =
                    database.GetItem("/sitecore/content/Target");

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

                //Assert
                Assert.AreEqual(item.ID.Guid.ToString("B").ToUpper(), result);
            }
        }