开发者

Testing VSTO Applications?

开发者 https://www.devze.com 2022-12-30 13:58 出处:网络
I\'m developing a Word 2007 VSTO application in VS2008. The part of the application that interacts with VSTO is difficult to test. VSTO objects behave differently than most class libraries. Their stat

I'm developing a Word 2007 VSTO application in VS2008. The part of the application that interacts with VSTO is difficult to test. VSTO objects behave differently than most class libraries. Their state and behav开发者_开发技巧iors depend on how the user is interacting with Word, where they clicked, what's around the insertion point, etc. Mock objects could work in some scenarios, but they don't capture many of the subtleties of the VSTO objects.

Anyone have any experience with testing a VSTO based application they can share?


Use encapsulation to separate your logic from the API code. It is a very similar to how you unit test code that interacts with your database. Generally you can trust the API will work, like the database, but it is your logic that needs to be isolated so you can test it properly.


I'm looking into this myself. A number of folks are pointing to Rhino Mocks http://hibernatingrhinos.com/open-source/rhino-mocks but I'd prefer use the real thing too. Have you tried varsha's msdn blog? http://blogs.msdn.com/b/varsha/archive/2010/08/17/writing-automated-test-cases-for-vsto-application.aspx?CommentPosted=true

0

精彩评论

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

关注公众号