Пример #1
0
        public async Task WhenImportGroupsSeparated_AndImportsNotSeparated_ImportsSeparated()
        {
            var testCode = @"
using Microsoft.CodeAnalysis;
using System.Linq;
using System;

class C
{
}";

            var expectedCode = @"
using Microsoft.CodeAnalysis;

using System;
using System.Linq;

class C
{
}";

            var editorConfig = new Dictionary <string, string>()
            {
                ["end_of_line"] = EndOfLineFormatter.GetEndOfLineOption(Environment.NewLine),
                ["dotnet_sort_system_directives_first"]     = "false",
                ["dotnet_separate_import_directive_groups"] = "true"
            };

            await AssertCodeChangedAsync(testCode, expectedCode, editorConfig);
        }
Пример #2
0
        public async Task WhenNeitherOptionIsConfigured_AndImportsNotSortedOrSeparated_NoChange()
        {
            var code = @"
using Microsoft.CodeAnalysis;
using System.Linq;
using System;

class C
{
}";

            var editorConfig = new Dictionary <string, string>()
            {
                ["end_of_line"] = EndOfLineFormatter.GetEndOfLineOption(Environment.NewLine)
            };

            await AssertCodeUnchangedAsync(code, editorConfig);
        }