Hey, I've come across some odd behavior where System.ComponentModel.Composition.Hosting.TypeCatalog instances initialized with generic type definitions lose track of their parts when running under NCrunch but not under the normal MSTest runner.
Here's the whole test file,
Code:
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Hosting;
using System.Linq;
namespace MinimumTypeCatalogIssue
{
[TestClass]
public class UnitTest1
{
public interface TestInterface
{
}
[Export(typeof(TestInterface))]
public class TestA<T> : TestInterface
{
}
[Export(typeof(TestInterface))]
public class TestB<T> : TestInterface
{
}
[TestMethod]
public void TestMethod1()
{
var catalog = new TypeCatalog(typeof(TestA<>), typeof(TestB<>));
Assert.AreNotEqual(0, catalog.Parts.Count());
}
}
}
Any clue on how to work around this one or if it can be fixed?