' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics Partial Public Class IOperationTests Inherits SemanticModelTestBase Public Sub PositionalArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub PositionalArgumentWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedArgumentListedInParameterOrder() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedArgumentListedOutOfParameterOrder() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedArgumentInParameterOrderWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedArgumentInParameterOrderWithDefaultValueUsingOmittedSyntax() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedArgumentOutOfParameterOrderWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedAndPositionalArgumentsWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub PositionalByRefNonModifiableArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub PositionalByRefModifiableArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedByRefModifiableArgumentsOutOfParameterOrder() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub DefaultValueForByRefParameter() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub PositionalByRefNonModifiableArgumentWithConversion() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub PositionalByRefModifiableArgumentWithConversion() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub PositionalArgumentForExtensionMethod() Dim source = Public Sub E1(a As P, Optional b As Integer = 0, Optional c As Integer = 0) End Sub End Module]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub NamedArgumentOutOfParameterOrderForExtensionMethod() Dim source = Public Sub E1(a As P, Optional b As Integer = 0, Optional c As Integer = 0) End Sub End Module]]>.Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub ParamsArrayArgumentInNormalForm() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub ParamsArrayArgumentInExpandedForm() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub ParamsArrayArgumentInExpandedFormWithNoArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Error_MissingRequiredArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Error_TooManyArguments() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Error_ExtraOmittedArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Error_OmittingParamArrayArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Error_NamedArgumentMatchingParamArray() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub Error_NamedArgumenNotExist() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub End Class End Namespace