Build/Test Issues

Tests in generic Test classes not recognized

Started by peitor on 7,860 views

I have a generic test class, that I reuse for different providers...
Sample code to reproduce


using NUnit.Framework;

namespace AuthenticationProvider.Business.Tests
{

[TestFixture]
public class InMemoryProviderTests : UserProviderTests<InMemoryUserProvider>
{

}

[TestFixture]
public class FileUserProviderTests : UserProviderTests<FileUserProvider>
{

}

[TestFixture]
public class UserProviderTests<T> where T: IProvideUserInfo, new()
{
const string Usercode = "Irrelevant String";
readonly IProvideUserInfo target = new T();

[Test]
public void GivenIAddNull_ItShouldReturnFalse()
{
var result = target.AddOrUpdate(Usercode, null);

Assert.That(result, Is.EqualTo(false));
}
}

}


NCrunch doesn't recognize the tests

See screenshot here
http://uploadpic.org/v.php?img=pvbtGxFYgC

[1] No dots
[2] No dots
[3] Black dot, should be green
[4] Black dot, Should be red
[5] TestDriven fails for FileUserProvider


Good job guys!!!

I have a couple of more feature requests, that I would like to send via email... This forum makes adding images so hard...
I have seen a similar problem around this to do with the inheritance of the InclusivelyUsesAttribute and ExclusivelyUsesAttribute ... didn't realise it would impact the test attributes also. I'll have a look into it.
For anyone interested, this issue should be fixed in the recently released 1.33b.

Post a reply

Log in to reply.