提交 75d8c9d7 编写于 作者: H Huo Yaoyuan

Move and rename test.

上级 1353fa4d
...@@ -262,7 +262,7 @@ void M(string s1, string s2) ...@@ -262,7 +262,7 @@ void M(string s1, string s2)
[WorkItem(23581, "https://github.com/dotnet/roslyn/issues/23581")] [WorkItem(23581, "https://github.com/dotnet/roslyn/issues/23581")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)] [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)]
public async Task TestValueParameterTypeIsUnconstrainedGeneric() public async Task TestValueParameterTypeIsUnconstrainedGeneric_CSharp7()
{ {
await TestInRegularAndScript1Async( await TestInRegularAndScript1Async(
@" @"
...@@ -290,6 +290,37 @@ public static void NotNull<T>(T value) ...@@ -290,6 +290,37 @@ public static void NotNull<T>(T value)
", new TestParameters(parseOptions: CSharp7)); ", new TestParameters(parseOptions: CSharp7));
} }
[WorkItem(23581, "https://github.com/dotnet/roslyn/issues/47972")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)]
public async Task TestValueParameterTypeIsUnconstrainedGeneric_CSharp8()
{
await TestInRegularAndScript1Async(
@"using System;
class C
{
public static void NotNull<T>(T value)
{
if ({|FixAllInDocument:ReferenceEquals|}(value, null))
{
return;
}
}
}",
@"using System;
class C
{
public static void NotNull<T>(T value)
{
if (value is null)
{
return;
}
}
}", new TestParameters(parseOptions: CSharp8));
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)] [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)]
public async Task TestValueParameterTypeIsUnconstrainedGenericNegated_CSharp7() public async Task TestValueParameterTypeIsUnconstrainedGenericNegated_CSharp7()
{ {
...@@ -504,7 +535,7 @@ void M(string s2) ...@@ -504,7 +535,7 @@ void M(string s2)
[WorkItem(23581, "https://github.com/dotnet/roslyn/issues/47972")] [WorkItem(23581, "https://github.com/dotnet/roslyn/issues/47972")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)] [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)]
public async Task TestValueParameterTypeIsBaseConstraintGeneric() public async Task TestValueParameterTypeIsBaseTypeConstraintGeneric()
{ {
await TestInRegularAndScript1Async( await TestInRegularAndScript1Async(
@"using System; @"using System;
...@@ -532,36 +563,5 @@ class C ...@@ -532,36 +563,5 @@ class C
} }
}", new TestParameters(parseOptions: CSharp7)); }", new TestParameters(parseOptions: CSharp7));
} }
[WorkItem(23581, "https://github.com/dotnet/roslyn/issues/47972")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIsNullCheck)]
public async Task TestUnconstrainedGenericInCSharp8()
{
await TestInRegularAndScript1Async(
@"using System;
class C
{
public static void NotNull<T>(T value)
{
if ({|FixAllInDocument:ReferenceEquals|}(value, null))
{
return;
}
}
}",
@"using System;
class C
{
public static void NotNull<T>(T value)
{
if (value is null)
{
return;
}
}
}", new TestParameters(parseOptions: CSharp8));
}
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册