Skip to content
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

Add a global using test #55180

Merged
merged 1 commit into from
Jul 28, 2021
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 @@ -23,7 +23,27 @@ public class TopLevelEditingTests : EditingTestBase
#region Usings

[Fact]
public void UsingDelete1()
public void Using_Global_Insert()
{
var src1 = @"
using System.Collections.Generic;
";
var src2 = @"
global using D = System.Diagnostics;
global using System.Collections;
using System.Collections.Generic;
";
var edits = GetTopEdits(src1, src2);

edits.VerifyEdits(
"Insert [global using D = System.Diagnostics;]@2",
"Insert [global using System.Collections;]@40");

edits.VerifyRudeDiagnostics();
}

[Fact]
public void Using_Delete1()
{
var src1 = @"
using System.Diagnostics;
Expand All @@ -37,7 +57,7 @@ public void UsingDelete1()
}

[Fact]
public void UsingDelete2()
public void Using_Delete2()
{
var src1 = @"
using D = System.Diagnostics;
Expand All @@ -57,7 +77,7 @@ public void UsingDelete2()
}

[Fact]
public void UsingInsert()
public void Using_Insert()
{
var src1 = @"
using System.Collections.Generic;
Expand All @@ -77,7 +97,7 @@ public void UsingInsert()
}

[Fact]
public void UsingUpdate1()
public void Using_Update1()
{
var src1 = @"
using System.Diagnostics;
Expand All @@ -98,7 +118,7 @@ public void UsingUpdate1()
}

[Fact]
public void UsingUpdate2()
public void Using_Update2()
{
var src1 = @"
using System.Diagnostics;
Expand All @@ -119,7 +139,7 @@ public void UsingUpdate2()
}

[Fact]
public void UsingUpdate3()
public void Using_Update3()
{
var src1 = @"
using System.Diagnostics;
Expand All @@ -140,7 +160,7 @@ public void UsingUpdate3()
}

[Fact]
public void UsingReorder1()
public void Using_Reorder1()
{
var src1 = @"
using System.Diagnostics;
Expand All @@ -159,7 +179,7 @@ public void UsingReorder1()
}

[Fact]
public void UsingInsertDelete1()
public void Using_InsertDelete1()
{
var src1 = @"
namespace N
Expand Down Expand Up @@ -189,7 +209,7 @@ namespace M
}

[Fact]
public void UsingInsertDelete2()
public void Using_InsertDelete2()
{
var src1 = @"
namespace N
Expand Down