Xunit以下构造函数参数没有匹配的夹具数据 [英] Xunit The following constructor parameters did not have matching fixture data

查看:55
本文介绍了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:

http://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以下构造函数参数没有匹配的夹具数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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