public void AccessModifiers_ProtectedPropertiesWriteToField() { //Assign MiscFixtureNS.AccessModifiersProtected target = null; Guid id = new Guid("{6FEE384F-3A05-4520-A80C-F80A6A454608}"); Item item = _db.GetItem(new ID(id)); using (new SecurityDisabler()) { item.Editing.BeginEdit(); item["SingleLineText"] = string.Empty; target = new MiscFixtureNS.AccessModifiersProtected(); target.GetProtectedSingleLineText = "Protected test"; _sitecore.WriteToItem(target, item); Assert.AreEqual("Protected test", item["SingleLineText"]); item.Editing.CancelEdit(); } }
public void AccessModifiers_ProtectedPropertiesWriteToField() { //Assign MiscFixtureNS.AccessModifiersProtected target = null; Guid id = new Guid("{6FEE384F-3A05-4520-A80C-F80A6A454608}"); Item item = _db.GetItem(new ID(id)); using (new SecurityDisabler()) { item.Editing.BeginEdit(); item["SingleLineText"] = string.Empty; target = new MiscFixtureNS.AccessModifiersProtected(); target.GetProtectedSingleLineText = "Protected test"; _sitecore.WriteToItem(target, item); Assert.AreEqual("Protected test", item["SingleLineText"]); item.Editing.CancelEdit(); } }