<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CSharp.Wrapping;
using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
using Microsoft.CodeAnalysis.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Wrapping
{
    public class IntializerExpressionWrappingTests : AbstractWrappingTests
    {
        protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspace workspace, TestParameters parameters)
            => new CSharpWrappingCodeRefactoringProvider();

        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsWrapping)]
        public async Task TestNoWrappingSuggestions()
        {
            await TestMissingAsync(
@"class C {
    void Bar() {
        var test = new[] [||]{ 1 };
    }
}");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsWrapping)]
        public async Task TestWrappingShortInitializerExpression()
        {
            await TestAllWrappingCasesAsync(
@"class C {
    void Bar() {
        var test = new[] [||]{ 1, 2 };
    }
}",
@"class C {
    void Bar() {
        var test = new[] 
        {
            1,
            2
        };
    }
}");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsWrapping)]
        public async Task TestWrappingLongIntializerExpression()
        {
            await TestAllWrappingCasesAsync(
@"class C {
    void Bar() {
        var test = new[] [||]{ ""the"", ""quick"", ""brown"", ""fox"", ""jumps"", ""over"", ""the"", ""lazy"", ""dog"" };
     }
}",
@"class C {
    void Bar() {
        var test = new[] 
        {
            ""the"",
            ""quick"",
            ""brown"",
            ""fox"",
            ""jumps"",
            ""over"",
            ""the"",
            ""lazy"",
            ""dog""};
        }
}",
@"class C {
    void Bar() {
        var test = new[] 
        {
            ""the"",""quick"",""brown"",""fox"",""jumps"",""over"",""the"",""lazy"",""dog""};
        }
}"
);
        }
    }
}
<commit_msg>Fix the long initializer test case that was failing<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.CSharp.Wrapping;
using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
using Microsoft.CodeAnalysis.Test.Utilities;
using Xunit;

namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Wrapping
{
    public class IntializerExpressionWrappingTests : AbstractWrappingTests
    {
        protected override CodeRefactoringProvider CreateCodeRefactoringProvider(Workspace workspace, TestParameters parameters)
            => new CSharpWrappingCodeRefactoringProvider();

        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsWrapping)]
        public async Task TestNoWrappingSuggestions()
        {
            await TestMissingAsync(
@"class C {
    void Bar() {
        var test = new[] [||]{ 1 };
    }
}");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsWrapping)]
        public async Task TestWrappingShortInitializerExpression()
        {
            await TestAllWrappingCasesAsync(
@"class C {
    void Bar() {
        var test = new[] [||]{ 1, 2 };
    }
}",
@"class C {
    void Bar() {
        var test = new[]
        {
            1,
            2
        };
    }
}");
        }

        [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsWrapping)]
        public async Task TestWrappingLongIntializerExpression()
        {
            await TestAllWrappingCasesAsync(
@"class C {
    void Bar() {
        var test = new[] [||]{ ""the"", ""quick"", ""brown"", ""fox"", ""jumps"", ""over"", ""the"", ""lazy"", ""dog"" };
     }
}",
@"class C {
    void Bar() {
        var test = new[]
        {
            ""the"",
            ""quick"",
            ""brown"",
            ""fox"",
            ""jumps"",
            ""over"",
            ""the"",
            ""lazy"",
            ""dog""
        };
     }
}",
@"class C {
    void Bar() {
        var test = new[]
        {
            ""the"", ""quick"", ""brown"", ""fox"", ""jumps"", ""over"", ""the"", ""lazy"", ""dog""
        };
     }
}"
);
        }
    }
}

{'fraction_non_alphanumeric': 0.15231638418079096, 'fraction_numerical': 0.0022598870056497176, 'mean_word_length': 2.2640117994100293, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3439094', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1339, 'n_words': 272}