<commit_before>namespace Gu.Wpf.PropertyGrid.UiTests
{
    using Gu.Wpf.UiAutomation;
    using NUnit.Framework;

    public class ColumnsTests
    {
        private static string WindowName = "ColumnsWindow";

        [OneTimeTearDown]
        public void OneTimeTearDown()
        {
            Application.KillLaunched(Info.ExeFileName);
        }

        [Test]
        public void Default()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("default");
                var expected = new[] { 6, 16, 7 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void Default_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("default abcd");
                var expected = new[] { 26, 46, 49 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }

        [Test]
        public void Star_star_star()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("* * *");
                var expected = new[] { 33, 33, 33 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }

        [Test]
        public void Width_15_20_25()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("Width 15 20 25");
                var expected = new[] { 15, 20, 25 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void Width_15_20_25_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("Width 15 20 25 abcd");
                var expected = new[] { 15, 20, 25 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("abcd").ColumnsWidths());
            }
        }

        [Test]
        public void MinWidth_15_20_25()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MinWidth 15 20 25");
                var expected = new[] { 15, 20, 25 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void MinWidth_15_20_25_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MinWidth 15 20 25 abcd");
                var expected = new[] { 26, 46, 49 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }

        [Test]
        public void MaxWidth_15_20_25()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MaxWidth 15 20 25");
                var expected = new[] { 6, 17, 7 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void MaxWidth_15_20_25_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MaxWidth 15 20 25 abcd");
                var expected = new[] { 15, 20, 25 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);

                expected = new[] { 15, 46, 3 }; // this looks strange but the textbox gets clipped here.
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }
    }
}<commit_msg>Amend.<commit_after>namespace Gu.Wpf.PropertyGrid.UiTests
{
    using Gu.Wpf.UiAutomation;
    using NUnit.Framework;

    public class ColumnsTests
    {
        private static string WindowName = "ColumnsWindow";

        [OneTimeTearDown]
        public void OneTimeTearDown()
        {
            Application.KillLaunched(Info.ExeFileName);
        }

        [Test]
        public void Default()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("default");
                var expected = new[] { 6, 16, 7 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void Default_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("default abcd");
                var expected = new[] { 26, 46, 49 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }

        [Test]
        public void Star_star_star()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("* * *");
                var expected = new[] { 33, 33, 33 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }

        [Test]
        public void Width_15_20_25()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("Width 15 20 25");
                var expected = new[] { 15, 20, 25 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void Width_15_20_25_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("Width 15 20 25 abcd");
                var expected = new[] { 15, 20, 25 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("abcd").ColumnsWidths());
            }
        }

        [Test]
        public void MinWidth_15_20_25()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MinWidth 15 20 25");
                var expected = new[] { 15, 20, 25 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void MinWidth_15_20_25_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MinWidth 15 20 25 abcd");
                var expected = new[] { 26, 46, 49 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }

        [Test]
        public void MaxWidth_15_20_25()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MaxWidth 15 20 25");
                var expected = new[] { 6, 17, 7 };
                CollectionAssert.AreEqual(expected, groupBox.FindTextBoxRow("a").ColumnsWidths());
            }
        }

        [Test]
        public void MaxWidth_15_20_25_abcd()
        {
            using (var app = Application.AttachOrLaunch(Info.ExeFileName, WindowName))
            {
                var window = app.MainWindow;
                var groupBox = window.FindGroupBox("MaxWidth 15 20 25 abcd");
                var expected = new[] { 15, 20, 25 };
                var actual = groupBox.FindTextBoxRow("a").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);

                expected = new[] { 15, 46, -1 }; // this looks strange but the textbox gets clipped here.
                actual = groupBox.FindTextBoxRow("abcd").ColumnsWidths();
                CollectionAssert.AreEqual(expected, actual);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.10202564579074522, 'fraction_numerical': 0.023601561048132318, 'mean_word_length': 1.706311289917023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5000999', 'n_tokens_mistral': 3062, 'n_tokens_neox': 2713, 'n_words': 584}