public void FunctionNodeWithNonGenericOutParameter_SetVariableTypes_TypeSetOnOutput() { NIType signatureType = Signatures.DefinePureUnaryFunction("unary", NITypes.Int32, NITypes.Int32); DfirRoot dfirRoot = DfirRoot.Create(); FunctionalNode functionalNode = new FunctionalNode(dfirRoot.BlockDiagram, signatureType); RunSemanticAnalysisUpToSetVariableTypes(dfirRoot); Terminal outputTerminal = functionalNode.OutputTerminals[1]; Assert.IsTrue(outputTerminal.GetTrueVariable().Type.IsInt32()); }
public void FunctionNodeWithNonGenericSignatureParameterAndIncorrectTypeWired_ValidateVariableUsages_ErrorCreated() { DfirRoot dfirRoot = DfirRoot.Create(); NIFunctionBuilder signatureTypeBuilder = PFTypes.Factory.DefineFunction("NonGenericInput"); Signatures.AddInputParameter(signatureTypeBuilder, PFTypes.Int32, "input"); NIType signatureType = signatureTypeBuilder.CreateType(); FunctionalNode functionalNode = new FunctionalNode(dfirRoot.BlockDiagram, signatureType); ConnectConstantToInputTerminal(functionalNode.InputTerminals[0], PFTypes.Boolean, false); RunSemanticAnalysisUpToValidation(dfirRoot); AssertTerminalHasTypeConflictMessage(functionalNode.InputTerminals[0]); }