Build/Test Issues

mspec and generic type behaviors not found by the runner

Started by antix on 6,399 views

Hi

If I have the following, the test (gets_a_thing) is not found by the runner

[Behaviors]
class test_behavior<TKey> {

protected It gets_a_thing = () => service.Get(key);

protected static IService<TKey> service;
protected static TKey key;
}

class test_impl_1{

Behaves_like<test_behavior<int>> test_behavoir;

Establish before_each
= () =>
{
service= new IntService();
key = 1;
};

protected static IService<TKey> service;
protected static TKey key;
}

If I take out the generic type on the behavior it works fine

I though it might be mspec, but, if I use the resharper test runner, the generic type behavior is found and the test is run
Hi, thanks for sharing this issue.

I've successfully reproduced this problem and can confirm that NCrunch does not properly recognise generic MSpec behaviors.

A fix for this issue will be included in the next version of NCrunch.


Cheers,

Remco
For anyone interested, a fix for this issue has been released recently with v1.39b of NCrunch.

Post a reply

Log in to reply.