Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

xUnit 2, ICollectionFixture not working
Der-Albert.com
#1 Posted : Tuesday, July 28, 2015 8:39:31 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 209

Thanks: 11 times
Was thanked: 55 time(s) in 51 post(s)
NCrunch seems to ignoring ICollectionFixture<T>

http://xunit.github.io/d...html#collection-fixture

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

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

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

the Collection Definition

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


and the the using of

Code:
    [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
Der-Albert.com
#2 Posted : Tuesday, July 28, 2015 8:45:05 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/17/2011(UTC)
Posts: 209

Thanks: 11 times
Was thanked: 55 time(s) in 51 post(s)
Suddenly it is working
Remco
#3 Posted : Tuesday, July 28, 2015 11:16:31 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.022 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download