Exemplo n.º 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() });
        }
Exemplo n.º 2
0
        public void InitTestContext()
        {
            ruleT1 = new TestRuleT1();
            ruleT2 = new TestRuleT2();
            ruleTN = new TestRuleTN();

            ruleDependent  = new OtherRuleT1();
            transformation = new MockTransformation(ruleT1, ruleT2, ruleTN, ruleDependent);
            transformation.Initialize();
            context = CreateContext(transformation);
            trace   = context.Trace;

            c_a   = context.CallTransformation(ruleT1, new object[] { "a" });
            c_b   = context.CallTransformation(ruleT1, new object[] { "b" });
            c_ab  = context.CallTransformation(ruleT2, new object[] { "a", "b" });
            c_bc  = context.CallTransformation(ruleT2, new object[] { "b", "c" });
            c_abc = context.CallTransformation(ruleTN, new object[] { "a", "b", "c" });
            c_bcd = context.CallTransformation(ruleTN, new object[] { "b", "c", "d" });

            c_a.InitializeOutput("b");
            c_b.InitializeOutput(null);
            c_ab.InitializeOutput("c");
            c_bc.InitializeOutput(null);
            c_abc.InitializeOutput("d");
            c_bcd.InitializeOutput(null);
        }
Exemplo n.º 3
0
Arquivo: Misc.cs Projeto: wasowski/NMF
        public void Transformations_AbstractTransformationRuleT2_CreateOutput()
        {
            var rule           = new TestAbstractRuleT2();
            var transformation = new MockTransformation(rule);
            var context        = new MockContext(transformation);

            rule.CreateOutput(new GenericParameterHelper(), new GenericParameterHelper(), context);
        }
Exemplo n.º 4
0
 public void InitTestContext()
 {
     ruleT1         = new TestRuleT1();
     ruleDependent  = new OtherRuleT1();
     transformation = new MockTransformation(ruleT1, ruleDependent);
     transformation.Initialize();
     context = new MockContext(transformation);
 }
Exemplo n.º 5
0
        public void InitTestContext()
        {
            ruleT1 = new TestOutputRuleT1();
            ruleT2 = new TestOutputRuleT2();
            otherT1 = new TestOutputRuleT1();
            otherT2 = new TestOutputRuleT2();

            transformation = new MockTransformation(ruleT1, ruleT2, otherT1, otherT2);
            context = new TransformationContext(transformation);
        }
Exemplo n.º 6
0
        public void InitTestContext()
        {
            ruleT1  = new TestOutputRuleT1();
            ruleT2  = new TestOutputRuleT2();
            otherT1 = new TestOutputRuleT1();
            otherT2 = new TestOutputRuleT2();

            transformation = new MockTransformation(ruleT1, ruleT2, otherT1, otherT2);
            context        = new TransformationContext(transformation);
        }
Exemplo n.º 7
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);
        }