且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在MVC 4中进行NerdDinner单元测试

更新时间:2023-11-16 23:05:10

这个方法被宣布为过时,因为在早在.NET v.2.0中引入泛型之后,根据类型的非泛型方法根本没有意义,它们在通用方法旁边太糟糕了。



从NUnit 2.5开始,提供了通用的等价物: IsInstanceOf< T> IsNotInstanceOf< T> IsAssignableFrom< T> IsNotAssignableFrom< T>

http://www.nunit.org/index.php? p = typeAsserts& r = 2.5.1 [ ^ ]。



所以,使用它们,不要使用过时的。



-SA
This method is declared obsolete, because, after introduction of generics as early as of .NET v.2.0, non-generic methods depending on types simply make no sense, they are just too bad next to generic ones.

Beginning with NUnit 2.5, generic equivalents are available: IsInstanceOf<T>, IsNotInstanceOf<T>, IsAssignableFrom<T> and IsNotAssignableFrom<T>:
http://www.nunit.org/index.php?p=typeAsserts&r=2.5.1[^].

So, use them, don''t use the obsolete.

—SA