Exemplo n.º 1
0
        public void Wire_SetVariableTypes_SinkAndSourceTerminalHaveSameVariable()
        {
            NIType         signatureType = Signatures.MutablePassthroughType;
            DfirRoot       dfirRoot      = DfirRoot.Create();
            FunctionalNode sink          = new FunctionalNode(dfirRoot.BlockDiagram, signatureType);
            Constant       constant      = Constant.Create(dfirRoot.BlockDiagram, 0, PFTypes.Int32);
            Wire           wire          = Wire.Create(dfirRoot.BlockDiagram, constant.OutputTerminal, sink.InputTerminals[0]);

            RunSemanticAnalysisUpToSetVariableTypes(dfirRoot);

            VariableReference wireSourceVariable = wire.SourceTerminal.GetTrueVariable(),
                              wireSinkVariable   = wire.SinkTerminals[0].GetTrueVariable();

            Assert.IsTrue(wireSourceVariable.ReferencesSame(wireSinkVariable));
        }
Exemplo n.º 2
0
 protected void AssertVariablesReferenceSame(VariableReference expected, VariableReference actual)
 {
     Assert.IsTrue(actual.ReferencesSame(expected));
 }