Skip to content

Add more tests for https://github.com/dotnet/roslyn/pull/76083 #76164

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

Merged
merged 4 commits into from
Dec 2, 2024
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 @@ -24,7 +24,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ImplementInterface;
[Trait(Traits.Feature, Traits.Features.CodeActionsImplementInterface)]
public sealed class ImplementInterfaceTests
{
private readonly NamingStylesTestOptionSets _options = new NamingStylesTestOptionSets(LanguageNames.CSharp);
private readonly NamingStylesTestOptionSets _options = new(LanguageNames.CSharp);

private static OptionsCollection AllOptionsOff
=> new(LanguageNames.CSharp)
Expand Down Expand Up @@ -602,6 +602,54 @@ public void Method1()
""");
}

[Theory, CombinatorialData, WorkItem("https://github.com/dotnet/roslyn/issues/26323")]
public async Task TestMethodWhenClassBracesAreMissing2(
[CombinatorialValues(0, 1)] int behavior)
{
await new VerifyCS.Test
{
TestCode = """
using System;

namespace WPFConsoleApplication1
{
class Program
{
private class Test : {|CS0535:ICloneable|}{|CS1513:|}{|CS1514:|}

static void Main(string[] args) { }
}
}
""",
FixedCode = """
using System;

namespace WPFConsoleApplication1
{
class Program
{
private class Test : ICloneable
{
public object Clone()
{
throw new NotImplementedException();
}
}

static void Main(string[] args) { }
}
}
""",
Options =
{
new OptionsCollection(LanguageNames.CSharp)
{
{ ImplementTypeOptionsStorage.InsertionBehavior, (ImplementTypeInsertionBehavior)behavior }
}
}
}.RunAsync();
}

[Fact]
public async Task TestInheritance1()
{
Expand Down
Loading