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)); }
protected void AssertVariablesReferenceSame(VariableReference expected, VariableReference actual) { Assert.IsTrue(actual.ReferencesSame(expected)); }