Example #1
0
        public void GenerDictionary_SameItemTypeIDictionaryCtor_IsDictionary()
        {
            IDictionaryResolver.TypeIsDictionary(typeof(_GenerDictionary_SameItemTypeIDictionaryCtor),
                                                 out ConstructorInfo constructor, out bool typeIsGeneric, out Type genericTypeDefinition, out Type genericKeyType, out Type genericValueType)
            .IsTrue();

            genericKeyType.Is(typeof(int));
            genericValueType.Is(typeof(int));
            constructor.Is(typeof(_GenerDictionary_SameItemTypeIDictionaryCtor).GetConstructor(new Type[] { typeof(Dictionary <int, int>) }));
        }
Example #2
0
        public void SortedListIsSpecifiedCapacityCtor()
        {
            IDictionaryResolver.TypeIsDictionary(typeof(SortedList <int, int>),
                                                 out ConstructorInfo constructor, out bool typeIsGeneric, out Type genericTypeDefinition, out Type genericKeyType, out Type genericValueType)
            .IsTrue();

            genericKeyType.Is(typeof(int));
            genericValueType.Is(typeof(int));
            constructor.Is(typeof(SortedList <int, int>).GetConstructor(new Type[] { typeof(int) }));
        }
Example #3
0
        public void GenerDictionary_EmptyParasCtor_IsDictionary()
        {
            IDictionaryResolver.TypeIsDictionary(typeof(_GenerDictionary_EmptyParasCtor),
                                                 out ConstructorInfo constructor, out bool typeIsGeneric, out Type genericTypeDefinition, out Type genericKeyType, out Type genericValueType)
            .IsTrue();

            genericKeyType.Is(typeof(int));
            genericValueType.Is(typeof(int));
            constructor.GetParameters().Length.Is(0);
        }
Example #4
0
 private static bool TypeIsIDictionary(Type t)
 {
     return(IDictionaryResolver.TypeIsDictionary(t, out ConstructorInfo constructor, out bool typeIsGeneric, out Type genericTypeDefinition, out Type genericKeyType, out Type genericValueType));
 }