-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added test to for ConfigurationContext #10535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Added a few suggestions for you to consider
@@ -17,9 +17,19 @@ public sealed class Check1 : Check | |||
|
|||
public override IReadOnlyList<CheckRule> SupportedRules { get; } = new List<CheckRule>() { SupportedRule }; | |||
|
|||
private string message = "Argument for the message format"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: message -> _message
using (var env = TestEnvironment.Create()) | ||
{ | ||
string checkCandidatePath = Path.Combine(TestAssetsRootPath, "CheckCandidate"); | ||
string message = ": An extra message for the analyzer"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ": An extra message for the check"
[Fact] | ||
public void CheckHasAccessToAllConfigs() | ||
{ | ||
using (var env = TestEnvironment.Create()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need env here and not the global _env?
// Can't use Transitive environment due to the need to dogfood local nuget packages. | ||
AddCustomDataSourceToNugetConfig(checkCandidatePath); | ||
string editorConfigName = Path.Combine(checkCandidatePath, EditorConfigFileName); | ||
File.WriteAllText(editorConfigName, ReadEditorConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: i beleive you can use the existing ReadEditorConfig() method located in the same file EndToEndTests.cs in order to populate config
Fixes #10291
Changes Made
Added test to see if Checks can access and use all configuration (custom and infra) available to them.