How to Mock and Unit Test SharePoint online(Microsoft.SharePoint.Client) custom code.

%3CLINGO-SUB%20id%3D%22lingo-sub-178364%22%20slang%3D%22en-US%22%3EHow%20to%20Mock%20and%20Unit%20Test%20SharePoint%20online(Microsoft.SharePoint.Client)%20custom%20code.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-178364%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20want%20to%20mock%20'%3CSPAN%3EListItemCollection'%20with%20test%20data%20without%20make%20any%20calls%20to%20SharePoint%26nbsp%3Blist.%26nbsp%3BWe%20tried%20moq%20and%20fake%20assemblies%20for%20Microsoft.sharepoint.client%20and%20facing%20error%20'invalid%20setup%20on%20non%20virtual%20member'%20on%20mocking%20ListItemCollection.%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Microsoft

We want to mock 'ListItemCollection' with test data without make any calls to SharePoint list. We tried moq and fake assemblies for Microsoft.sharepoint.client and facing error 'invalid setup on non virtual member' on mocking ListItemCollection. 

0 Replies