From 22106db8afc0b4fc3ba944bed63e14ed256e6e7e Mon Sep 17 00:00:00 2001 From: Madalyn Redding Date: Fri, 10 Jul 2020 16:18:07 -0400 Subject: [PATCH] fixing file names pt 3 --- .../ConvertTypeofToNameoFixAllTests.cs | 114 ----------- .../ConvertTypeofToNameofTests.cs | 193 ------------------ 2 files changed, 307 deletions(-) delete mode 100644 src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameoFixAllTests.cs delete mode 100644 src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameofTests.cs diff --git a/src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameoFixAllTests.cs b/src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameoFixAllTests.cs deleted file mode 100644 index ee747600873e6..0000000000000 --- a/src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameoFixAllTests.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.CSharp.ConvertTypeofToNameof; -using Microsoft.CodeAnalysis.CSharp.CSharpConvertNameOfCodeFixProvider; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics; -using Microsoft.CodeAnalysis.Test.Utilities; -using Xunit; - -namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ConvertTypeofToNameof -{ - public partial class ConvertTypeofToNameofTests - { - [Fact] - [Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - [Trait(Traits.Feature, Traits.Features.CodeActionsFixAllOccurrences)] - public async Task SingleDocumentBasic() - { - var input = @"class Test -{ - static void Main() - { - var typeName1 = {|FixAllInDocument:typeof(Test).Name|}; - var typeName2 = typeof(Test).Name; - var typeName3 = typeof(Test).Name; - } -} -"; - - var expected = @"class Test -{ - static void Main() - { - var typeName1 = nameof(Test); - var typeName2 = nameof(Test); - var typeName3 = nameof(Test); - } -} -"; - - await TestInRegularAndScriptAsync(input, expected); - } - - [Fact] - [Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - [Trait(Traits.Feature, Traits.Features.CodeActionsFixAllOccurrences)] - public async Task SingleDocumentVaried() - { - var input = @"class Test -{ - static void Main() - { - var typeName1 = {|FixAllInDocument:typeof(Test).Name|}; - var typeName2 = typeof(int).Name; - var typeName3 = typeof(System.String).Name; - } -} -"; - - var expected = @"class Test -{ - static void Main() - { - var typeName1 = nameof(Test); - var typeName2 = nameof(System.Int32); - var typeName3 = nameof(System.String); - } -} -"; - - await TestInRegularAndScriptAsync(input, expected); - } - - [Fact] - [Trait(Traits.Feature, Traits.Features.Con)] - [Trait(Traits.Feature, Traits.Features.CodeActionsFixAllOccurrences)] - public async Task SingleDocumentVariedWithUsing() - { - var input = @"using System; - -class Test -{ - static void Main() - { - var typeName1 = typeof(Test).Name; - var typeName2 = typeof(int).Name; - var typeName3 = typeof(String).Name; - var typeName4 = {|FixAllInDocument:typeof(System.Double).Name|}; - } -} -"; - - var expected = @"using System; - -class Test -{ - static void Main() - { - var typeName1 = nameof(Test); - var typeName2 = nameof(Int32); - var typeName3 = nameof(String); - var typeName4 = nameof(Double); - } -} -"; - - await TestInRegularAndScriptAsync(input, expected); - } - } -} diff --git a/src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameofTests.cs b/src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameofTests.cs deleted file mode 100644 index 4ec4fcbcc3b57..0000000000000 --- a/src/Analyzers/CSharp/Tests/ConvertTypeofToNameof/ConvertTypeofToNameofTests.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Threading.Tasks; -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.CSharp.ConvertTypeofToNameof; -using Microsoft.CodeAnalysis.CSharp.CSharpConvertTypeofToNameofCodeFixProvider; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Diagnostics; -using Microsoft.CodeAnalysis.Test.Utilities; -using Xunit; - -namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.ConvertNameOf -{ - public partial class ConvertNameOfTests : AbstractCSharpDiagnosticProviderBasedUserDiagnosticTest - { - internal override (DiagnosticAnalyzer, CodeFixProvider) CreateDiagnosticProviderAndFixer(Workspace workspace) - => (new CSharpConvertTypeofToNameofDiagnosticAnalyzer(), new CSharpConvertTypeofToNameofCodeFixProvider()); - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task BasicType() - { - var text = @" -class Test -{ - void Method() - { - var typeName = [||]typeof(Test).Name; - } -} -"; - var expected = @" -class Test -{ - void Method() - { - var typeName = [||]nameof(Test); - } -} -"; - await TestInRegularAndScriptAsync(text, expected); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task ClassLibraryType() - { - var text = @" -class Test -{ - void Method() - { - var typeName = [||]typeof(System.String).Name; - } -} -"; - var expected = @" -class Test -{ - void Method() - { - var typeName = [||]nameof(System.String); - } -} -"; - await TestInRegularAndScriptAsync(text, expected); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task ClassLibraryTypeWithUsing() - { - var text = @" -using System; - -class Test -{ - void Method() - { - var typeName = [||]typeof(String).Name; - } -} -"; - var expected = @" -using System; - -class Test -{ - void Method() - { - var typeName = [||]nameof(String); - } -} -"; - await TestInRegularAndScriptAsync(text, expected); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task NotOnVariableContainingType() - { - var text = @"using System; - -class Test -{ - void Method() - { - var typeVar = typeof(String);[||] - var typeName = typeVar.Name; - } -} -"; - await TestMissingInRegularAndScriptAsync(text); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task PrimitiveType() - { - var text = @" -class Test -{ - void Method() - { - [||]var typeName = typeof(int).Name; - } -} -"; - var expected = @"class Test -{ - void Method() - { - [||]var typeName = nameof(System.Int32); - } -} -"; - await TestInRegularAndScriptAsync(text, expected); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task PrimitiveTypeWithUsing() - { - var text = @"using System; - -class Test -{ - void Method()[||] - { - var typeName = typeof(int).Name; - } -} -"; - var expected = @"using System; - -class Test -{ - void Method()[||] - { - var typeName = nameof(Int32); - } -} -"; - await TestInRegularAndScriptAsync(text, expected); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task NotOnGenericType() - { - var text = @"class Test -{ - void Method()[||] - { - var typeName = typeof(T).Name; - } -} -"; - await TestMissingInRegularAndScriptAsync(text); - } - - [Fact, Trait(Traits.Feature, Traits.Features.ConvertTypeofToNameof)] - public async Task NotOnSimilarStatements() - { - var text = @"class Test -{ - void Method()[||] - { - var typeName1 = typeof(Test); - var typeName2 = typeof(Test).toString(); - var typeName3 = typeof(Test).FullName; - } -} -"; - await TestMissingInRegularAndScriptAsync(text); - } - } -}