SharePoint Workflow Unit Testing

I was wondering if there are existing unit testing solutions for Windows Workflow. Fundamental processes running in the context of SharePoint .

Unfortunately, the SharePoint libraries were not designed with the ability to test or ridicule.
Such workflows are usually closely associated with SharePoint classes that require the installation and launch of a SharePoint instance, which is completely inefficient for testing.

The following is a list of issues that I encountered while trying to unit test an existing workflow:

  • Workflows make calls to static SharePoint objects;
  • Some of the mocking EventArgs classes are internal to the SharePoint assembly;
  • Workflows can use special SharePoint Workflow Actions , which in turn cause calls to SharePoint;
  • There is no convenient API for starting a workflow in the context of SharePoint and monitoring its status.

I solved these problems for a specific workflow that I had to test using Microsoft Moles and might someday release my solution as an open source.
Meanwhile, I am wondering if any of you have ever tested SharePoint Workflow. If so, I would like to hear about your solutions to these (and possibly some other) problems. I would also like to know if your library would be interesting if I release it.

Thanks.

+4
source share
1 answer

Unit testing processes? In general, unit testing of Sharepoint is rather complicated.

I used two frames along with Sharepoint:

None of these frameworks can test the actions of Microsoft Sharepoint or, in particular, the workflows created using SHarepoint Designer, since they are sealed, and you should consider them β€œworkers” anyway - Microsoft made them, they are perfect !: - )

Your library is certainly of great interest, since not many people try unit test Sharepoint because of the nature of Sharepoints in my eyes: you use many built-in functions and just configure and possibly add to this functionality - basically you only want to check / unit test native code.

Sorry, I can’t give you details about the problems I encountered - Typemock was definitely more powerful to use because it is much older and more mature - Pex & Moles is fun (I found the Sharepoint tutorial quite enjoyable: Unit Testing SharePoint Foundation with Microsoft Pex and Mole .

+2
source

Source: https://habr.com/ru/post/1341009/


All Articles