示例#1
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);
        }