コード例 #1
0
        public void Transformations_TransformationContext_ExecuteAfter1()
        {
            var dep = new TestDependency(false);

            ruleT1.Dependencies.Add(dep);

            var comp = context.CallTransformation(ruleT1, "a");

            context.CallPendingDependencies();

            Assert.IsTrue(dep.IsHandled);
        }
コード例 #2
0
ファイル: DelayTest.cs プロジェクト: wasowski/NMF
        public void Transformations_TransformationContext_DelayedSinglePersistorT1_1()
        {
            bool persistorCalled = false;

            ruleT1.SetOutputDelayLevel(2);
            ruleT1.Call(otherT1, persistor: (s1, s2) =>
            {
                Assert.AreEqual(s1, s2);
                persistorCalled = true;
            });

            context.CallTransformation(ruleT1, "a");
            context.CallPendingDependencies();

            Assert.IsFalse(ruleT1.OutputCreated);
            Assert.IsFalse(persistorCalled);
            Assert.IsTrue(otherT1.OutputCreated);

            context.CreateDelayedOutputs();

            Assert.IsTrue(ruleT1.OutputCreated);
            Assert.IsTrue(persistorCalled);
            Assert.IsTrue(otherT1.OutputCreated);
        }