Exemple #1
0
        public void AdjustWidths_TwoInterleavedColumnsWayTooWide()
        {
            var columns  = new[] { 10, 2000, 20, 3000, 15 };
            var actual   = AccessibleListView.AdjustWidths(columns, 1045);
            var expected = new[] { 10, 400, 20, 600, 15 };

            EnumerableExtensions.EnumerateSame(expected, actual);
        }
Exemple #2
0
        public void AdjustWidths_OneColumnWayTooWide()
        {
            var columns  = new[] { 2000 };
            var actual   = AccessibleListView.AdjustWidths(columns, 1000);
            var expected = new[] { 1000 };

            EnumerableExtensions.EnumerateSame(expected, actual);
        }
Exemple #3
0
        public void AdjustWidths_FirstColumnWayTooWide()
        {
            var columns  = new[] { 13657, 80, 97, 110 };
            var actual   = AccessibleListView.AdjustWidths(columns, 1664);
            var expected = new[] { 1377, 80, 97, 110 };

            EnumerableExtensions.EnumerateSame(expected, actual);
        }
Exemple #4
0
        public void AdjustWidths_ColumnsThatFitAreUnchanged()
        {
            var columns = new[] { 80, 97, 110, 102 };
            var sum     = columns.Sum();
            var actual  = AccessibleListView.AdjustWidths(columns, sum);

            EnumerableExtensions.EnumerateSame(columns, actual);
        }
Exemple #5
0
        public void AdjustWidths_SixColumnsWayTooWide()
        {
            var columns = new[] { 200, 200, 200, 200, 200, 200 };
            var actual  = AccessibleListView.AdjustWidths(columns, 1000);

            // all columns are less than 20%; let the multiplier take care of it later
            EnumerableExtensions.EnumerateSame(columns, actual);
        }
Exemple #6
0
        public void AdjustWidths_FiveColumnsWayTooWide()
        {
            var columns  = new[] { 200, 200, 200, 200, 200 };
            var actual   = AccessibleListView.AdjustWidths(columns, 999);
            var expected = new[] { 199, 199, 199, 199, 199 };

            EnumerableExtensions.EnumerateSame(expected, actual);
        }
Exemple #7
0
        public void AdjustWidths_EmptyList()
        {
            var actual = AccessibleListView.AdjustWidths(EmptyWidthList, 0);

            EnumerableExtensions.EnumerateSame(EmptyWidthList, actual);
        }