AutoFixture 与 NBuilder

发布于 2024-09-01 17:39:28 字数 356 浏览 4 评论 0原文

我正在选择用测试数据填充我的 .net 模型 (poco) 的工具。我实际上是在模拟 wcf 服务,并且需要用测试数据填充数据契约对象。发现了大量的测试数据生成工具,但大多数与数据库测试数据生成相关,不太适合.net 对象创建。

我发现最适用的是:

  1. AutoFixture
  2. NBuilder

它们似乎都提供非常相似的功能。我对有关这些工具的任何反馈感兴趣。优点和缺点?

I'm selecting tool for populating my .net models (poco) with test data. I'm actually mocking wcf services and need to populate datacontract objects with test data. Found a huge number of test data generation tools, but the majority is related to DB test data generation and don't fit well for .net objects creation.

The most applicable that I found are:

  1. AutoFixture
  2. NBuilder

They both seem to provide quite similar functionality. I'm interested in any feedback on those tools. Pros and cons?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

臻嫒无言 2024-09-08 17:39:28

嗨,当我遇到这两个时,我正在创建自己的测试构建器。
我已经尝试了这两种方法,发现自动固定装置要好得多,它具有更丰富的语法,非常灵活,并且更容易修改以供我自己使用。

Marks 的测试非常出色,写得很好,再加上他的 博客 应该可以帮助您顺利完成。

布雷特

Hi I was in the process of creating my own test builder when I ran into these two.
I have tried both and found autofixture to be far preferable it has a richer syntax is extremely flexible and was easier to modify for my own use.

Marks tests are excellent, well written and this mixed with his blog should get you most of the way there.

brett

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文