' 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.Test.Utilities Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics Partial Public Class IOperationTests Inherits SemanticModelTestBase Public Sub RaiseInstanceEvent() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseInstanceEventWithArguments() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseSharedEvent() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseInstanceEventWithExtraArgument() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseUndefinedEvent() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseEventThroughField1() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseEventThroughField2() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseCustomEvent() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RaiseCustomEventWithArguments() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of RaiseEventStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub EventAccessFromRaiseCustomEventShouldNotReturnOperation() Dim source = .Value Dim expectedDiagnostics = String.Empty VerifyNoOperationTreeForTest(Of IdentifierNameSyntax)(source) End Sub End Class End Namespace