public void TestIList() { //Type foo = typeof(ICollection<int>).GetGenericTypeDefinition(); //Assert.IsTrue(typeof(IList<>) == typeof(IList<>)); Assert.IsTrue(GenericTypeUtil.IsGenericIList(typeof(IList <>))); //Type[] foo = typeof(ICollection<int>).GetInterfaces(); //IList<int> list = new List<int>(); //Assert.IsTrue(TypeUtil.GenericICollectionIsAssignableFrom(typeof(IList<int>))); //Type foo = typeof(IList<int>).GetInterface(typeof(IList<>).FullName); //Type[] foo = typeof(ICollection<int>).GetInterfaces(); //Console.WriteLine(foo); }
public static bool IsICollectionPropertyGetter(MethodInfo method) { return(IsPropertyGetter(method) && GenericTypeUtil.IsGenericICollection(method.ReturnType)); }
public void TestArrayIsICollection() { int[] i = new int[10]; Assert.IsTrue(GenericTypeUtil.IsGenericICollection(i.GetType())); }