提交 413b4f74 编写于 作者: J Julia Feng

update test cases

上级 b2f66339
......@@ -2458,6 +2458,7 @@ public class C[||]
@"
#nullable enable
using System;
using System.Collections.Generic;
namespace N
{
......@@ -2473,7 +2474,7 @@ public override bool Equals(object? obj)
public static bool operator ==(C? left, C? right)
{
return global::System.Collections.Generic.EqualityComparer<global::N.C>.Default.Equals(left, right);
return EqualityComparer<C>.Default.Equals(left, right);
}
public static bool operator !=(C? left, C? right)
......@@ -2532,53 +2533,6 @@ public override bool Equals(object? obj)
}",
chosenSymbols: null,
optionsCallback: options => EnableOption(options, GenerateOperatorsId),
parameters: CSharpLatestImplicit);
}
[WorkItem(40053, "https://github.com/dotnet/roslyn/issues/40053")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsGenerateEqualsAndGetHashCode)]
public async Task TestGenerateOperators5()
{
await TestWithPickMembersDialogAsync(
@"
using System;
namespace N
{
public class C[||]
{
public int X;
}
}",
@"
using System;
namespace N
{
public class C
{
public int X;
public override bool Equals(object obj)
{
return obj is C c &&
X == c.X;
}
public static bool operator ==(C left, C right)
{
return left.Equals(right);
}
public static bool operator !=(C left, C right)
{
return !(left == right);
}
}
}",
chosenSymbols: null,
optionsCallback: options => EnableOption(options, GenerateOperatorsId),
parameters: CSharpLatestImplicit);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册