forked from icsharpcode/CodeConverter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue icsharpcode#854: Add test for Handles cluase having different c…
…ase for property with event, use semantic model to get official name of the property
- Loading branch information
Showing
2 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using System.Threading.Tasks; | ||
|
||
using ICSharpCode.CodeConverter.Tests.TestRunners; | ||
using ICSharpCode.CodeConverter.VB; | ||
|
||
using Xunit; | ||
|
||
namespace ICSharpCode.CodeConverter.Tests.VB | ||
{ | ||
|
||
public class CaseSensitivityTests : ConverterTestBase | ||
{ | ||
[Fact] | ||
public async Task HandlesWithDifferingCaseTestAsync() | ||
{ | ||
await TestConversionVisualBasicToCSharpAsync(@"Public Class VBIsCaseInsensitive | ||
Inherits System.Web.UI.Page | ||
Private Sub btnOK_Click(sender As Object, e As System.EventArgs) Handles btnOK.Click | ||
End Sub | ||
End Class | ||
Partial Public Class VBIsCaseInsensitive | ||
Protected WithEvents btnOk As Global.System.Web.UI.WebControls.Button | ||
End Class | ||
", | ||
@"using System; | ||
using System.Runtime.CompilerServices; | ||
public partial class VBIsCaseInsensitive : System.Web.UI.Page | ||
{ | ||
private void btnOK_Click(object sender, EventArgs e) | ||
{ | ||
} | ||
} | ||
public partial class VBIsCaseInsensitive | ||
{ | ||
private System.Web.UI.WebControls.Button _btnOk; | ||
protected virtual System.Web.UI.WebControls.Button btnOk | ||
{ | ||
[MethodImpl(MethodImplOptions.Synchronized)] | ||
get | ||
{ | ||
return _btnOk; | ||
} | ||
[MethodImpl(MethodImplOptions.Synchronized)] | ||
set | ||
{ | ||
if (_btnOk != null) | ||
{ | ||
_btnOk.Click -= btnOK_Click; | ||
} | ||
_btnOk = value; | ||
if (_btnOk != null) | ||
{ | ||
_btnOk.Click += btnOK_Click; | ||
} | ||
} | ||
} | ||
}", hasLineCommentConversionIssue: true /*Fields re-ordered*/); | ||
} | ||
|
||
|
||
|
||
} | ||
} |