コード例 #1
0
        public void InitTestContext()
        {
            ruleT1 = new TestRuleT1();
            ruleT2 = new TestRuleT2();
            ruleTN = new TestRuleTN();

            baseT1 = new BaseTestRuleT1();
            baseT2 = new BaseTestRuleT2();
            baseTN = new BaseTestRuleTN();

            otherRuleT1 = new OtherRuleT1();
            otherRuleT2 = new OtherRuleT2();
            otherRuleTN = new OtherRuleTN();

            transformation = new MockTransformation(
                ruleT1, ruleT2, ruleTN,
                baseT1, baseT2, baseTN,
                otherRuleT1, otherRuleT2, otherRuleTN);
            transformation.Initialize();

            context = new MockContext(transformation);

            c_a   = context.Computations.Add(ruleT1, "a");
            c_ab  = context.Computations.Add(ruleT2, "a", "b");
            c_abc = context.Computations.Add(ruleTN, new object[] { "a", "b", "c" });

            c_other1 = context.Computations.Add(otherRuleT1, new Dummy());
            c_other2 = context.Computations.Add(otherRuleT2, new Dummy(), new Dummy());
            c_otherN = context.Computations.Add(otherRuleTN, new object[] { new Dummy(), new Dummy(), new Dummy() });
        }
コード例 #2
0
        public void InitTestContext()
        {
            ruleT1         = new TestRuleT1();
            ruleDependent  = new OtherRuleT1();
            transformation = new MockTransformation(ruleT1, ruleDependent);
            transformation.Initialize();
            context = new MockContext(transformation);

            dependency = new MultipleDependency();

            dependency.BaseTransformation       = ruleT1;
            dependency.DependencyTransformation = ruleDependent;
            dependency.ExecuteBefore            = true;

            c_Test      = new MockComputation(new object[] { "a" }, ruleT1, context, "b");
            c_Dependent = new MockComputation(new object[] { new Dummy() }, ruleDependent, context, new Dummy());

            context.Computations.Add(c_Test);
            context.Computations.Add(c_Dependent);
        }