@@ -62,6 +62,64 @@ public void RaisingFlour()
6262}" ) ;
6363 }
6464
65+ [ Fact ]
66+ public async Task TestEventsOnInterfaceAsync ( )
67+ {
68+ await TestConversionVisualBasicToCSharpAsync (
69+ @"Public Interface IFileSystem
70+
71+ Event FileChanged(FileData As String)
72+ Event FileCreated(FileData As String)
73+ Event FileDeleted(FileData As String)
74+ Event FileRenamed(e As RenamedEventArgs)
75+ Event WatcherError(e As ErrorEventArgs)
76+
77+ End Interface
78+
79+ Public Class FileSystemWin
80+ Implements IFileSystem
81+
82+ Public Event FileChanged(FileData As String) Implements IFileSystem.FileChanged
83+ Public Event FileCreated(FileData As String) Implements IFileSystem.FileCreated
84+ Public Event FileDeleted(FileData As String) Implements IFileSystem.FileDeleted
85+ Public Event FileRenamed(e As RenamedEventArgs) Implements IFileSystem.FileRenamed
86+ Public Event WatcherError(e As ErrorEventArgs) Implements IFileSystem.WatcherError
87+
88+ End Class" , @"using System.IO;
89+
90+ public partial interface IFileSystem
91+ {
92+ event FileChangedEventHandler FileChanged;
93+
94+ delegate void FileChangedEventHandler(string FileData);
95+
96+ event FileCreatedEventHandler FileCreated;
97+
98+ delegate void FileCreatedEventHandler(string FileData);
99+
100+ event FileDeletedEventHandler FileDeleted;
101+
102+ delegate void FileDeletedEventHandler(string FileData);
103+
104+ event FileRenamedEventHandler FileRenamed;
105+
106+ delegate void FileRenamedEventHandler(RenamedEventArgs e);
107+
108+ event WatcherErrorEventHandler WatcherError;
109+
110+ delegate void WatcherErrorEventHandler(ErrorEventArgs e);
111+ }
112+
113+ public partial class FileSystemWin : IFileSystem
114+ {
115+ public event IFileSystem.FileChangedEventHandler FileChanged;
116+ public event IFileSystem.FileCreatedEventHandler FileCreated;
117+ public event IFileSystem.FileDeletedEventHandler FileDeleted;
118+ public event IFileSystem.FileRenamedEventHandler FileRenamed;
119+ public event IFileSystem.WatcherErrorEventHandler WatcherError;
120+ }" ) ;
121+ }
122+
65123 [ Fact ]
66124 public async Task TestModuleHandlesWithEventsAsync ( )
67125 {
0 commit comments