Ejemplo n.º 1
0
            public ClockSocket(ProjectTester tester)
            {
                this.Tester = tester;
                Assert.AreEqual(5, this.Tester.Input.Length);
                Assert.AreEqual(3, this.Tester.Output.Length);

                this.clock = new InputSocket(tester.Input[0]);
                this.mPlus = new InputSocket(tester.Input[1]);
                this.hPlus = new InputSocket(tester.Input[2]);
                this.s0    = new InputSocket(tester.Input[2]);
                this.clr   = new InputSocket(tester.Input[3]);

                this.h = new OutputSocket(tester.Output[0]);
                this.m = new OutputSocket(tester.Output[1]);
                this.s = new OutputSocket(tester.Output[2]);
            }
Ejemplo n.º 2
0
        public void CircuitMapDeepWireLoopTest()
        {
            ProjectTester tester = new ProjectTester(this.TestContext, Properties.Resources.CircuitMapTests, "DeepWireLoopTest");
            InputSocket   input  = new InputSocket(tester.Input[0]);
            OutputSocket  target = new OutputSocket(tester.Output[0]);
            Action <int>  test   = value => {
                input.Value = value;
                tester.CircuitState.Evaluate(true);
                Assert.AreEqual(value, target.BinaryInt());
            };

            tester.CircuitProject.InOmitTransaction(() => {
                for (int i = 0; i < 10; i++)
                {
                    test(i & 1);
                }
            });
        }