提交 a64c77f7 编写于 作者: C Cyrus Najmabadi

Update tests

上级 946bd3f0
......@@ -7,6 +7,7 @@
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseIndexOrRangeOperator
......@@ -334,6 +335,7 @@ void Goo(S s)
}", parameters: s_testParameters);
}
[WorkItem(36909, "https://github.com/dotnet/roslyn/issues/36909")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseIndexOperator)]
public async Task TestMissingWithNoSystemIndex()
{
......
......@@ -7,6 +7,7 @@
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.UseIndexOrRangeOperator
......@@ -58,11 +59,27 @@ void Goo(string s)
</Workspace>");
}
[WorkItem(36909, "https://github.com/dotnet/roslyn/issues/36909")]
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseRangeOperator)]
public async Task TestNotWithoutSystemRange()
{
await TestMissingInRegularAndScriptAsync(
@"
class C
{
void Goo(string s)
{
var v = s.Substring([||]1, s.Length - 1);
}
}", new TestParameters(parseOptions: s_parseOptions));
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsUseRangeOperator)]
public async Task TestSimple()
{
await TestAsync(
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s)
......@@ -71,6 +88,7 @@ void Goo(string s)
}
}",
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s)
......@@ -85,6 +103,7 @@ public async Task TestComplexSubstraction()
{
await TestAsync(
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s, int bar, int baz)
......@@ -93,6 +112,7 @@ void Goo(string s, int bar, int baz)
}
}",
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s, int bar, int baz)
......@@ -107,6 +127,7 @@ public async Task TestConstantSubtraction1()
{
await TestAsync(
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s)
......@@ -115,6 +136,7 @@ void Goo(string s)
}
}",
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s)
......@@ -183,6 +205,7 @@ public async Task TestFixAllInvocationToElementAccess1()
// simplify even further.
await TestAsync(
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s, string t)
......@@ -191,6 +214,7 @@ void Goo(string s, string t)
}
}",
@"
namespace System { public struct Range { } }
class C
{
void Goo(string s, string t)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册