Build/Test Issues

xUnit 2, ICollectionFixture not working

Started by Der-Albert.com on 7,946 views

NCrunch seems to ignoring ICollectionFixture<T>

http://xunit.github.io/docs/shared-context.html#collection-fixture

I my case i have simple Fixture (just setting up Mappings for AutoMapper)

    public class AutoMapperFixture : IDisposable
    {
        public AutoMapperFixture()
        {
            AutoMapperForTests.AddMappingsFromAssemblyOf<UserMapping>();
        }

        public void Dispose()
        {
            AutoMapperForTests.ResetMappings();
        }
    }

the Collection Definition

   [CollectionDefinition(AutoMapperCollection.Name)]
    public class AutoMapperCollection : ICollectionFixture<AutoMapperFixture>
    {
        public const string Name = "AutoMapperCollection";
    }


and the the using of

    [Collection(AutoMapperCollection.Name)]

    public class UserApiControllerCreateUser : WebApiAutoFixtureMoq<UsersApiController> {
    }


in this case i'm im not doing a constructor injection of the AutoMapperFixture.

Works in Visual Studio, Visual Studio Online, ReSharper, Command Line but works not in NCrunch 2.15.

I may also the case the IClassFixture<T> is also not working

Edited

I'm fairly certain NCrunch should have handling for this. There are a number of test cases around it ...

Let me know if you find a way to reproduce the problem consistently.

Post a reply

Log in to reply.