' 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 Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics Partial Public Class IOperationTests Inherits SemanticModelTestBase Public Sub AddEventHandler() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RemoveEventHandler() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub AddEventHandler_StaticEvent() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RemoveEventHandler_StaticEvent() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = String.Empty VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub RemoveEventHandler_DelegateTypeMismatch() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub AddEventHandler_AssignToSharedEventOnInstance() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub Public Sub AddEventHandler_AssignToNonSharedEventOnType() Dim source = .Value Dim expectedOperationTree = .Value Dim expectedDiagnostics = .Value VerifyOperationTreeAndDiagnosticsForTest(Of AddRemoveHandlerStatementSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub End Class End Namespace