/// <summary>
        /// Creates a computation mock for the given transformation rule with the given input and the given context and adds the computation to the context
        /// </summary>
        /// <param name="transformationRule">The transformation rule for this computation mock</param>
        /// <param name="input">The input for this computation</param>
        /// <returns>The computation mock</returns>
        public MockComputation Add(GeneralTransformationRule transformationRule, object[] input)
        {
            var c = new MockComputation(input, transformationRule, CreateComputationContext());

            Add(c);
            return(c);
        }
        public MockComputation Add <TIn>(GeneralTransformationRule <TIn> transformationRule, TIn input)
            where TIn : class
        {
            var c = new MockComputation(new object[] { input }, transformationRule, CreateComputationContext());

            Add(c);
            return(c);
        }
        public MockComputation Add <TOut>(TransformationRuleBase <TOut> transformationRule, object[] input, TOut output)
            where TOut : class
        {
            var c = new MockComputation(input, transformationRule, CreateComputationContext(), output);

            Add(c);
            return(c);
        }
        public MockComputation Add <TIn1, TIn2>(GeneralTransformationRule <TIn1, TIn2> transformationRule, TIn1 input1, TIn2 input2)
            where TIn1 : class
            where TIn2 : class
        {
            var c = new MockComputation(new object[] { input1, input2 }, transformationRule, CreateComputationContext());

            Add(c);
            return(c);
        }
        public MockComputation Add <TIn1, TIn2, TOut>(TransformationRuleBase <TIn1, TIn2, TOut> transformationRule, TIn1 input1, TIn2 input2, TOut output)
            where TIn1 : class
            where TIn2 : class
            where TOut : class
        {
            var c = new MockComputation(new object[] { input1, input2 }, transformationRule, CreateComputationContext(), output);

            Add(c);
            return(c);
        }
Ejemplo n.º 6
0
        public void InitTestContext()
        {
            ruleT1 = new TestRuleT1();
            ruleDependent = new OtherRuleT1();
            transformation = new MockTransformation(ruleT1, ruleDependent);
            transformation.Initialize();
            context = new MockContext(transformation);

            dependency = new SingleDependency();

            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, null);

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