Skip to content

Commit

Permalink
Merge pull request #4921 from sharwell/update-tests
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
sharwell authored Mar 4, 2021
2 parents 0bf2e61 + 466769e commit fdbc1a3
Show file tree
Hide file tree
Showing 53 changed files with 1,083 additions and 219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ public class C
{accessibility} interface I {{ }}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
ExpectedDiagnostics =
{
Expand Down Expand Up @@ -208,7 +212,11 @@ Public Class C
End Interface
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
ExpectedDiagnostics =
{
Expand Down Expand Up @@ -237,7 +245,11 @@ public class C
{accessibility} interface I {{ }}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
}
}.RunAsync();
}
Expand All @@ -262,7 +274,11 @@ Public Class C
End Interface
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
}
}.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ public class OuterClass
{accessibility} class [|C|]<T1, T2, T3> {{ }}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText), },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
"), },
},
}.RunAsync();
}
Expand Down Expand Up @@ -177,7 +181,11 @@ Public Class OuterClass
End Class
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText), },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
"), },
},
}.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ public class C
}}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
}
}.RunAsync();

Expand All @@ -116,7 +120,11 @@ Public Class C
End Sub
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
}
}.RunAsync();
}
Expand Down Expand Up @@ -147,7 +155,11 @@ public class C
}}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics =
{
GetCSharpExpectedResult(4, 11 + accessibility.Length)
Expand Down Expand Up @@ -175,7 +187,11 @@ Public Class C
End Sub
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics =
{
GetBasicExpectedResult(5, 10 + accessibility.Length)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ public class C
{accessibility} void [|M|](CancellationToken t, int i) {{}}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();
}
Expand Down Expand Up @@ -536,7 +540,11 @@ Public Class C
End Sub
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();
}
Expand Down Expand Up @@ -576,7 +584,11 @@ public class C2
public " + prefix + "C2" + suffix + @"(CancellationToken t, int i) {}
}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();

Expand All @@ -602,7 +614,11 @@ Public Class C2
End Sub
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();
}
Expand Down Expand Up @@ -630,7 +646,11 @@ public async Task CA1068_ExcludedSymbolNames_Record_NoDiagnostic(string editorCo
public record " + prefix + "R" + suffix + @"(CancellationToken t, int i) {}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,11 @@ public class C : IDictionary
IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();
}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics = { GetCA1010CSharpResultAt(5, 14, "C", "ICollection", "ICollection<T>") },
}
}.RunAsync();
Expand Down Expand Up @@ -1035,7 +1039,11 @@ Throw New NotImplementedException()
End Function
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics = { GetCA1010CSharpResultAt(5, 14, "C", "ICollection", "ICollection(Of T)") },
}
}.RunAsync();
Expand Down Expand Up @@ -1088,7 +1096,11 @@ public class C : IDictionary
IEnumerator IEnumerable.GetEnumerator() => throw new NotImplementedException();
}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics = { GetCA1010CSharpResultAt(5, 14, "C", "IDictionary", "IDictionary<TKey, TValue>") },
}
}.RunAsync();
Expand Down Expand Up @@ -1186,7 +1198,11 @@ Throw New NotImplementedException()
End Function
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics = { GetCA1010CSharpResultAt(5, 14, "C", "IDictionary", "IDictionary(Of TKey, TValue)") },
}
}.RunAsync();
Expand All @@ -1208,7 +1224,11 @@ public async Task UserMappingWinsOverHardcoded_NoDiagnostic()
public class TestClass : CollectionBase { }"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics = { GetCA1010CSharpResultAt(4, 14, "TestClass", "IList", "IDictionary<TKey, TValue>") },
}
}.RunAsync();
Expand All @@ -1227,7 +1247,11 @@ Inherits CollectionBase
End Class
"
},
AdditionalFiles = { (".editorconfig", editorConfigText) },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") },
ExpectedDiagnostics = { GetCA1010BasicResultAt(4, 14, "TestClass", "IList", "IDictionary(Of TKey, TValue)") },
}
}.RunAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,11 @@ void M1(string param)
}}
}}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();

Expand All @@ -697,7 +701,11 @@ End Try
End Sub
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
}
}.RunAsync();
}
Expand Down Expand Up @@ -750,7 +758,11 @@ void M1(string param)
}
}"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
},
}.RunAsync();

Expand All @@ -771,7 +783,11 @@ End Sub
End Class
End Namespace"
},
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
}
}.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ Protected [|SomeField|] As Integer
End Class
End Class"
},
AdditionalFiles = { (".editorconfig", editorConfigText), },
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
"), },
},
}.RunAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ public struct S
TestState =
{
Sources = { csharpCode },
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
}
}.RunAsync();

Expand All @@ -415,7 +419,11 @@ Public Structure S
TestState =
{
Sources = { vbCode },
AdditionalFiles = { (".editorconfig", editorConfigText) }
AnalyzerConfigFiles = { ("/.editorconfig", $@"root = true
[*]
{editorConfigText}
") }
}
}.RunAsync();
}
Expand Down
Loading

0 comments on commit fdbc1a3

Please sign in to comment.