Ejemplo n.º 1
0
        public void ConnectPostCreating()
        {
            IInputEndpoint input1       = new InputEndpoint();
            Int32          inputSignal1 = 0;

            input1.Receive += (sender, signal) => { inputSignal1 = signal; };
            IInputEndpoint input2       = new InputEndpoint();
            Int32          inputSignal2 = 0;

            input2.Receive += (sender, signal) => { inputSignal2 = signal; };
            IOutputEndpoint  output  = new OutputEndpoint();
            INeutralEndpoint netrual = new NeutralEndpoint();

            Nexus nexus = new Nexus(6, input1, output, netrual);

            output.Produce(1);
            Assert.AreEqual(inputSignal1, 1);
            Assert.AreEqual(inputSignal2, 0);

            nexus.ConnectAt(input2, 3);
            Assert.AreEqual(inputSignal1, 1);
            Assert.AreEqual(inputSignal2, 1);
        }