确保项目处于编辑模式

检查传递的 Item 是否处于编辑模式。如果没有,它会抛出一个 EditingNotAllowedException。

Assert.IsEditing(Sitecore.Context.Item);