Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit b6c68f2

Browse files
committed
Test for explicitly implemented indexer
1 parent f454290 commit b6c68f2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Microsoft.DotNet.CodeFormatting.Tests/Rules/ExplicitVisibilityRuleTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public void TestExplicitInterfaceImplementation()
118118
var text = @"
119119
interface I1
120120
{
121+
int this[int index] { get; set; }
121122
int Prop { get; set; }
122123
void M();
123124
event EventHandler E;
@@ -130,6 +131,11 @@ int I1.Prop
130131
get { return 0; }
131132
set { }
132133
}
134+
int I1.this[int index]
135+
{
136+
get { return 0; }
137+
set { }
138+
}
133139
void I1.M() { }
134140
event EventHandler I1.E;
135141
void M() { }
@@ -139,6 +145,7 @@ void M() { }
139145
var expected = @"
140146
internal interface I1
141147
{
148+
int this[int index] { get; set; }
142149
int Prop { get; set; }
143150
void M();
144151
event EventHandler E;
@@ -151,6 +158,11 @@ int I1.Prop
151158
get { return 0; }
152159
set { }
153160
}
161+
int I1.this[int index]
162+
{
163+
get { return 0; }
164+
set { }
165+
}
154166
void I1.M() { }
155167
event EventHandler I1.E;
156168
private void M() { }

0 commit comments

Comments
 (0)