Hi, examine the following trivial sample:
=========================================================
namespace ListContractTest
{
  internal static class TypeFactory
  {
    internal static IEnumerable<Type> GetTypes()
    {
      yield return typeof(int);
    }
  }

  [TestFixture]
  public class ListContractTest<[Factory(typeof(TypeFactory),
"GetTypes")] T>
  {
    [VerifyContract]
    public readonly IContract CollectionTests = new
ListContract<ReadOnlyCollection<int>, int>
    {
      IsReadOnly = true,
      DefaultInstance = () => new ReadOnlyCollection<int>(new[] { 0,
5, 7, 2 }),
      DistinctInstances = new DistinctInstanceCollection<int>(new[]
{ 5, 10 }),
    };
  }
}
=========================================================

Trying to run the fixture yields the following error message:
System.InvalidOperationException: Late bound operations cannot be
performed on fields with types for which
Type.ContainsGenericParameters is true.
   at System.Reflection.RtFieldInfo.GetValue(Object obj)

Is it by design?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/mbunituser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to