简体   繁体   中英

What are some strategies for unit testing workflows in WF 4?

I've done quite a bit of WF development using 3.5 over the last few years, but am just now ramping up on WF in 4.0. I have a TDD bent, and while WF 3.5 was difficult at times to unit test, I'm wondering if anyone could share their strategy for unit testing workflows in WF 4 and/or point me to resources that would help get me started?

The easiest approach is, just like in WF35, to separate the implementation from the activity so they can be tested independently of each other. The activity extension is just a regular class so use whatever you are comfortable with. Most activities can be unit tested quite easily using the WorklfowInvoker.

I completely agree with Maurice on testing activities independently. For unit testing workflow services, there is now Microsoft.Activities.UnitTesting . Download from the CodePlex page .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM