Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,25 @@ public static IEnumerable<object[]> FixedWithAppendAddsUsingDirectiveTestData()
};
}

[ConditionalTheory]
[OSSkipCondition(OperatingSystems.Linux)]
[OSSkipCondition(OperatingSystems.MacOSX)]
[Theory]
[MemberData(nameof(FixedWithAppendAddsUsingDirectiveTestData))]
public async Task IHeaderDictionary_WithAdd_FixedWithAppend_AddsUsingDirective(string source, string fixedSource)
{
// Source is cloned on Windows with CRLF line endings, then the test is run by Helix in Windows/Linux/macOS.
// When Roslyn adds a new `using`, it gets added followed by Environment.NewLine.
// For Linux/macOS, the actual result is `\n`, however, the source is cloned on Windows with CRLF expectation.
// We replace all line endings with Environment.NewLine to avoid this.

// Arrange & Act & Assert
await VerifyCS.VerifyCodeFixAsync(
source.TrimStart(),
source.TrimStart().ReplaceLineEndings(),
new[]
{
new DiagnosticResult(DiagnosticDescriptors.DoNotUseIHeaderDictionaryAdd)
.WithLocation(0)
.WithMessage(Resources.Analyzer_HeaderDictionaryAdd_Message)
},
fixedSource.TrimStart(),
fixedSource.TrimStart().ReplaceLineEndings(),
codeActionEquivalenceKey: AppendCodeActionEquivalenceKey);
}

Expand Down