Xunit以下构造函数参数没有匹配的夹具数据

编程入门 行业动态 更新时间:2024-10-28 17:29:40
本文介绍了Xunit以下构造函数参数没有匹配的夹具数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在将xunit用于.NET 1.0框架net46时,我一直收到此错误.

I keep getting this error while using xunit for .NET 1.0 framework net46.

The following constructor parameters did not have matching fixture data

我看过这篇文章:收藏夹不会注入,并按照有关如下所述紧密收集夹具:

I have seen this post: Collection fixture won't inject and followed the instructions regarding collection fixture closely as described here:

xunit.github.io/docs/shared-context.html#collection-fixture

似乎没有任何作用.

有什么建议可能导致这种情况吗?

Any suggestions to what might cause this?

推荐答案

在我看来,这是按照说明正确执行操作的问题.我误把班级注释为

In my case it turned out to be a matter of doing it right according to the instructions. By mistake I had annotated the class with

[Collection("ProjectCollection")]

代替:

[Collection("ActorProjectCollection")]

我必须说,如果错误消息更加明确地指出了错误所在,则XUnit的依赖项注入机制将得到极大改善.

I must say that the dependency injection mechanism of XUnit would be greatly improved if the error messages gave more explicit hint of what is wrong.

更多推荐

Xunit以下构造函数参数没有匹配的夹具数据

本文发布于:2023-11-15 18:11:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1596788.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:夹具   函数   参数   数据   Xunit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!