Ejemplo n.º 1
0
        public void TypeParameterPassedToBaseClassSameClass()
        {
            IReturnType[] stringArr = { msc.SystemTypes.String };
            IReturnType   rrt       = new ConstructedReturnType(EnumerableClass.DefaultReturnType, stringArr);
            IReturnType   res       = MemberLookupHelper.GetTypeParameterPassedToBaseClass(rrt, EnumerableClass, 0);

            Assert.AreEqual("System.String", res.FullyQualifiedName);
        }
Ejemplo n.º 2
0
        public void TypeParameterPassedToBaseClassTestClassDerivingFromList()
        {
            DefaultClass listDerivingClass = CreateClassDerivingFromListOfString();

            IReturnType res = MemberLookupHelper.GetTypeParameterPassedToBaseClass(listDerivingClass.DefaultReturnType,
                                                                                   EnumerableClass, 0);

            Assert.AreEqual("System.String", res.FullyQualifiedName);
        }
Ejemplo n.º 3
0
        public void TypeParameterPassedToBaseClassTestDictionary()
        {
            IReturnType[] stringInt = { msc.SystemTypes.String, msc.SystemTypes.Int32 };
            IReturnType   rrt       = new ConstructedReturnType(DictionaryRT, stringInt);
            IReturnType   res       = MemberLookupHelper.GetTypeParameterPassedToBaseClass(rrt, EnumerableClass, 0);

            Assert.AreEqual("System.Collections.Generic.KeyValuePair", res.FullyQualifiedName);
            ConstructedReturnType resc = res.CastToConstructedReturnType();

            Assert.AreEqual("System.String", resc.TypeArguments[0].FullyQualifiedName);
            Assert.AreEqual("System.Int32", resc.TypeArguments[1].FullyQualifiedName);
        }
Ejemplo n.º 4
0
        public void TypeParameterPassedToBaseClassTestGenericClassDerivingFromList()
        {
            DefaultClass listDerivingClass = CreateGenericClassDerivingFromList();

            ConstructedReturnType testType = new ConstructedReturnType(listDerivingClass.DefaultReturnType,
                                                                       new IReturnType[] { msc.SystemTypes.String });

            IReturnType res = MemberLookupHelper.GetTypeParameterPassedToBaseClass(testType,
                                                                                   EnumerableClass, 0);

            Assert.AreEqual("System.String", res.FullyQualifiedName);
        }
Ejemplo n.º 5
0
        public void TypeParameterPassedToBaseClassTestString()
        {
            IReturnType res = MemberLookupHelper.GetTypeParameterPassedToBaseClass(msc.SystemTypes.String, EnumerableClass, 0);

            Assert.AreEqual("System.Char", res.FullyQualifiedName);
        }