예제 #1
0
        public void Add(IPatch patch)
        {
            PatchContainer pc = new PatchContainer(patch);

            mapping.Add(patch, pc);
            rootSet.Add(pc);
        }
예제 #2
0
        public void PatchDetectOutletValueChangeDuringExecution()
        {
            ChangeOutlet   patch = new ChangeOutlet();
            PatchContainer pc    = new PatchContainer(patch);

            Assert.IsFalse(patch.output.HasChanged, "#1");
            pc.ExecutePatch();
            Assert.IsTrue(patch.output.HasChanged, "#2");
        }
예제 #3
0
        public void Connect(IPatch from, string outlet, IPatch to, string inlet)
        {
            PatchContainer fromCont = mapping [from];
            PatchContainer toCont   = mapping [to];

            rootSet.Remove(toCont);

            fromCont.GetOutlet(outlet).ConnectTo(toCont.GetInlet(inlet));
        }
예제 #4
0
        public void PatchDetectInletValueChangeBetweenExecutions()
        {
            CheckInletChanged patch = new CheckInletChanged();
            PatchContainer    pc    = new PatchContainer(patch);

            Assert.IsFalse(patch.hasChanged, "#1");

            pc.ExecutePatch();
            Assert.IsFalse(patch.hasChanged, "#2");

            patch.input.Value = 20;
            pc.ExecutePatch();
            Assert.IsTrue(patch.hasChanged, "#3");

            pc.ExecutePatch();
            Assert.IsFalse(patch.hasChanged, "#4");
        }