Esempio n. 1
0
        public void TestInit()
        {
            TestUtils.ResetLINQLibrary();

            MEFUtilities.AddPart(new TypeHandlers.TypeHandlerConvert());
            MEFUtilities.AddPart(new ROFirstLast());
            MEFUtilities.AddPart(new ROAggregate());
        }
Esempio n. 2
0
 public void Setup()
 {
     TestUtils.ResetLINQLibrary();
     MEFUtilities.AddPart(new ArrayArrayInfoFactory());
     MEFUtilities.AddPart(new SubQueryArrayTypeFactory());
     MEFUtilities.AddPart(new TranslatedArrayInfoFactory());
     MEFUtilities.AddPart(new HandleGroupType());
     MEFUtilities.AddPart(new MemberAccessArrayTypeFactory());
     MEFUtilities.AddPart(new SubQueryExpressionArrayInfoFactory());
 }
        internal void TestLookupTwice(int tindex)
        {
            var t = GenerateAType(tindex);

            MEFUtilities.AddPart(new DummyRO());
            var target = new QVResultOperators();

            MEFUtilities.Compose(target);

            var result1 = target.FindScalarROProcessor(t);
            var result2 = target.FindScalarROProcessor(t);

            Assert.AreEqual(result1, result2, "Expected the same result when called with the same inputs!");
        }
Esempio n. 4
0
        public void TestMethodCall()
        {
            var looker = new BogusTT();
            var target = new TypeHandlerCache();

            MEFUtilities.AddPart(looker);
            MEFUtilities.Compose(target);

            var           m    = typeof(int).GetMethods().Where(me => me.Name == "ToString").First();
            var           expr = Expression.Call(Expression.Constant(10), m);
            GeneratedCode gc   = new GeneratedCode();

            var result = CodeMethodCall(target, expr, gc);

            Assert.AreEqual(result.Type, typeof(int), "result type");
        }
Esempio n. 5
0
        public void ProcessConstantRefROOT()
        {
            var looker = new BogusTT();
            var target = new TypeHandlerCache();

            MEFUtilities.AddPart(looker);
            MEFUtilities.Compose(target);

            ConstantExpression expr = Expression.Constant(new ROOTNET.NTH1F("hi", "there", 10, 0.0, 10.0));
            GeneratedCode      gc   = new GeneratedCode();

            var v = ProcessConstantReference(target, expr, gc);

            Assert.AreEqual("dude", v.RawValue);
            Assert.AreEqual(typeof(ROOTNET.NTH1F), v.Type);
        }
Esempio n. 6
0
        private static IValue RunArrayLengthOnExpression(Expression arrayLenLambda, Type expectedType)
        {
            MEFUtilities.AddPart(new QVResultOperators());
            MEFUtilities.AddPart(new ROCount());
            MEFUtilities.AddPart(new TypeHandlerCache());
            MEFUtilities.AddPart(new TypeHandlerTranslationClass());
            GeneratedCode gc = new GeneratedCode();
            CodeContext   cc = new CodeContext();

            MEFUtilities.Compose(new QueryVisitor(gc, cc, MEFUtilities.MEFContainer));

            var result = ExpressionToCPP.GetExpression(arrayLenLambda, gc, cc, MEFUtilities.MEFContainer);

            Assert.IsNotNull(result, "result");
            Assert.AreEqual(expectedType, result.Type, "result type");
            return(result);
        }
        internal void TestLookup(int tindex)
        {
            var t     = GenerateAType(tindex);
            var dummy = new DummyRO();

            MEFUtilities.AddPart(dummy);
            var target = new QVResultOperators();

            MEFUtilities.Compose(target);

            var result = target.FindScalarROProcessor(t);

            if (t == typeof(DummyRO))
            {
                Assert.AreEqual(dummy, result, "expected to get back the right object");
            }
            else
            {
                Assert.IsNull(result, "Expected no found guy to come back!");
            }
        }
Esempio n. 8
0
 public void Setup()
 {
     TestUtils.ResetLINQLibrary();
     MEFUtilities.AddPart(new QVResultOperators());
     MEFUtilities.Compose(new TypeHandlerCache());
 }
Esempio n. 9
0
 public void Setup()
 {
     TestUtils.ResetLINQLibrary();
     MEFUtilities.AddPart(new LINQToTTreeLib.Variables.Savers.SaveSimpleVariable());
 }
Esempio n. 10
0
 public void TestInit()
 {
     TestUtils.ResetLINQLibrary();
     MEFUtilities.AddPart(new VSBasic());
 }