Skip to content

Commit

Permalink
Merge pull request #73634 from CyrusNajmabadi/fileScopedNamespace
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi authored May 22, 2024
2 parents 8bbe4ef + d623561 commit 3df090b
Show file tree
Hide file tree
Showing 838 changed files with 457,390 additions and 458,228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,38 @@
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.AddAccessibilityModifiers
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.AddAccessibilityModifiers;

[Trait(Traits.Feature, Traits.Features.CodeActionsAddAccessibilityModifiers)]
public class AddAccessibilityModifiersFixAllTests : AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor
{
[Trait(Traits.Feature, Traits.Features.CodeActionsAddAccessibilityModifiers)]
public class AddAccessibilityModifiersFixAllTests : AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest_NoEditor
public AddAccessibilityModifiersFixAllTests(ITestOutputHelper logger)
: base(logger)
{
}

internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
=> (new CSharpAddAccessibilityModifiersDiagnosticAnalyzer(), new CSharpAddAccessibilityModifiersCodeFixProvider());

[Fact, WorkItem("https://github.com/dotnet/vscode-csharp/issues/6611")]
[Trait(Traits.Feature, Traits.Features.CodeActionsFixAllOccurrences)]
public async Task TestFixAllInContainingType_DoesNotCrashInDuplicateProgramInTopLevelStatements()
{
public AddAccessibilityModifiersFixAllTests(ITestOutputHelper logger)
: base(logger)
{
}

internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace)
=> (new CSharpAddAccessibilityModifiersDiagnosticAnalyzer(), new CSharpAddAccessibilityModifiersCodeFixProvider());

[Fact, WorkItem("https://github.com/dotnet/vscode-csharp/issues/6611")]
[Trait(Traits.Feature, Traits.Features.CodeActionsFixAllOccurrences)]
public async Task TestFixAllInContainingType_DoesNotCrashInDuplicateProgramInTopLevelStatements()
{
var input = """
Console.WriteLine("Hello, World!");
class {|FixAllInContainingType:Program|}
{
}
""";

var expected = """
Console.WriteLine("Hello, World!");
internal class Program
{
}
""";

await TestAsync(input, expected, TestParameters.Default.parseOptions);
}
var input = """
Console.WriteLine("Hello, World!");
class {|FixAllInContainingType:Program|}
{
}
""";

var expected = """
Console.WriteLine("Hello, World!");
internal class Program
{
}
""";

await TestAsync(input, expected, TestParameters.Default.parseOptions);
}
}
Loading

0 comments on commit 3df090b

Please sign in to comment.