public static SPListItemCollection GetItemsReadyForPublish(SPWeb tempWeb)
{
SPList stagingLibrary = tempWeb.Lists["examplelibrary"];
SPQuery CamlQuery = new SPQuery();
CamlQuery.Query = $"<Where><Eq><FieldRef Name='{"DocumentStatus"}'/><Value Type='Text'>{"Ready For Publish""}</Value></Eq></Where>";
CamlQuery.ViewAttributes = "Scope="Recursive"";
SPListItemCollection itemCollection = stagingLibrary.GetItems(CamlQuery);
return itemCollection;
}
在这个SharePoint中,有很多库,我想获取;示例库";。
有人能帮我写下使用垫片的此功能的测试用例吗。我很难伪造SharePoint列表,因为没有文档可供参考,这是我第一次为SharePoint做这件事
我发现了一种很好的材料。https://www.slideshare.net/stevedxu/better-unit-testing-with-microsoft-fakes-rtm