开发者

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

开发者 https://www.devze.com 2023-01-05 11:20 出处:网络
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 t

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消