Rhino Mocks 可以为我写我的 Expect 语句吗? [英] Can Rhino Mocks Write My Expect Statements For Me?

查看:40
本文介绍了Rhino Mocks 可以为我写我的 Expect 语句吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组与远程数据库通信的 Visual Studio Team System 单元(实际上是集成)测试.测试变得太慢和笨拙.我想用模拟版本替换整个测试集.问题是编写所有的expect 语句来模拟整个数据库的功能是很痛苦的.

I have a set of Visual Studio Team System unit (integration really) tests that talk to a remote database. The tests are getting too slow and unwieldy. I'd like to replace the entire set of tests with mocked out versions. The problem is it's painful to write all the expect statements that mimic what an entire database does.

有谁知道可以运行现有测试的工具或附加组件,找出非模拟版本实际返回的内容并写出 Expect.Call 来复制功能?我知道这是一个远景,但我觉得它应该是可能的.

Does anyone know of a tool or add-on that will run an existing test, figure out what the non-mocked version actually returns and write out the Expect.Call's to duplicate the functionality? I know this is a long shot, but I feel like it should be possible.

推荐答案

好吧,我最终自己写了.这是博客文章概述:

Ok, I ended up writing it myself. Here is the blog post overview:

编写我的 Rhino Mocks Expect 声明

这是 CodePlex 项目:

And here is the CodePlex project:

WriteMyExpectStatement

希望这对某人有所帮助.

Hope this helps someone somewhere.

这篇关于Rhino Mocks 可以为我写我的 Expect 语句吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆