NUnit cannot create generic instance?

Hello.  We recently started using generic tests in our code.  For example:

    [TestFixture(typeof(User))]
    public class EntityMappingTests<TEntity>


These tests run fine in both TestDriven.Net and the NUnit GUI.  However, when I try to run them in TC, I get a load of these errors:

    Cannot create an instance of ..EntityMappingTests`1[TEntity] because Type.ContainsGenericParameters is true.

According to a CodeProject article, this is the error that NUnit 2.4 threw when it encountered such tests (because generic tests were a new feature in 2.5).  However, when I look at the TC process's .NET references in Process Explorer, I see that it is indeed loading NUnit 2.5.5 as I've specified in the TC configuration.

Here are my settings:

settings.png

And here is TC in Process Explorer:

nunit-ver.png

So it seems to be picking up the right version.

NUnit does not appear at all in my GAC.  Does anyone have any idea what might be wrong here?

(Thanks in advance for any help!)

2 comments

This issue was fixed in 6.0 EAP.
Please have a look at
http://youtrack.jetbrains.net/issue/TW-11945

The fix will be available in TeamCity 5.1.3 too.
Please follow the workaround from the issue.

0

Excellent - that workaround did the trick, and I'll look forward to a new version.

Thanks so much for the help!

0

Please sign in to leave a comment.