コード例 #1
0
ファイル: ListViewTests.cs プロジェクト: dut3062796s/winforms
        public void ListView_DoubleBuffered_Get_ReturnsExpected(bool value)
        {
            var control = new SubListView();

            control.SetStyle(ControlStyles.OptimizedDoubleBuffer, value);
            Assert.Equal(value, control.DoubleBuffered);
        }
コード例 #2
0
ファイル: ListViewTests.cs プロジェクト: dut3062796s/winforms
        public void ListView_CreateParams_GetDefault_ReturnsExpected()
        {
            var          control      = new SubListView();
            CreateParams createParams = control.CreateParams;

            Assert.Null(createParams.Caption);
            Assert.Equal("SysListView32", createParams.ClassName);
            Assert.Equal(0x8, createParams.ClassStyle);
            Assert.Equal(0x200, createParams.ExStyle);
            Assert.Equal(97, createParams.Height);
            Assert.Equal(IntPtr.Zero, createParams.Parent);
            Assert.Null(createParams.Param);
            Assert.Equal(0x56010148, createParams.Style);
            Assert.Equal(121, createParams.Width);
            Assert.Equal(0, createParams.X);
            Assert.Equal(0, createParams.Y);
            Assert.Same(createParams, control.CreateParams);
        }
コード例 #3
0
ファイル: ListViewTests.cs プロジェクト: dut3062796s/winforms
        public void ListView_DoubleBuffered_Set_GetReturnsExpected(bool value)
        {
            var control = new SubListView
            {
                DoubleBuffered = value
            };

            Assert.Equal(value, control.DoubleBuffered);
            Assert.Equal(value, control.GetStyle(ControlStyles.OptimizedDoubleBuffer));

            // Set same.
            control.DoubleBuffered = value;
            Assert.Equal(value, control.DoubleBuffered);
            Assert.Equal(value, control.GetStyle(ControlStyles.OptimizedDoubleBuffer));

            // Set different.
            control.DoubleBuffered = !value;
            Assert.Equal(!value, control.DoubleBuffered);
            Assert.Equal(!value, control.GetStyle(ControlStyles.OptimizedDoubleBuffer));
        }
コード例 #4
0
ファイル: ListViewTests.cs プロジェクト: dut3062796s/winforms
        public void ListView_Ctor_Default()
        {
            var listView = new SubListView();

            Assert.Equal(ItemActivation.Standard, listView.Activation);
            Assert.Equal(ListViewAlignment.Top, listView.Alignment);
            Assert.False(listView.AllowColumnReorder);
            Assert.False(listView.AllowDrop);
            Assert.Equal(AnchorStyles.Top | AnchorStyles.Left, listView.Anchor);
            Assert.True(listView.AutoArrange);
            Assert.False(listView.AutoSize);
            Assert.Equal(SystemColors.Window, listView.BackColor);
            Assert.Null(listView.BackgroundImage);
            Assert.Equal(ImageLayout.Tile, listView.BackgroundImageLayout);
            Assert.False(listView.BackgroundImageTiled);
            Assert.Null(listView.BindingContext);
            Assert.Equal(BorderStyle.Fixed3D, listView.BorderStyle);
            Assert.Equal(97, listView.Bottom);
            Assert.Equal(new Rectangle(0, 0, 121, 97), listView.Bounds);
            Assert.True(listView.CanEnableIme);
            Assert.True(listView.CanRaiseEvents);
            Assert.True(listView.CausesValidation);
            Assert.False(listView.CheckBoxes);
            Assert.Empty(listView.CheckedIndices);
            Assert.Same(listView.CheckedIndices, listView.CheckedIndices);
            Assert.Empty(listView.CheckedItems);
            Assert.Same(listView.CheckedItems, listView.CheckedItems);
            Assert.Equal(new Size(117, 93), listView.ClientSize);
            Assert.Equal(new Rectangle(0, 0, 117, 93), listView.ClientRectangle);
            Assert.Empty(listView.Columns);
            Assert.Same(listView.Columns, listView.Columns);
            Assert.Null(listView.Container);
            Assert.Null(listView.ContextMenu);
            Assert.Null(listView.ContextMenuStrip);
            Assert.Empty(listView.Controls);
            Assert.Same(listView.Controls, listView.Controls);
            Assert.False(listView.Created);
            Assert.Equal(Cursors.Default, listView.Cursor);
            Assert.Same(Cursors.Default, listView.DefaultCursor);
            Assert.Equal(ImeMode.Inherit, listView.DefaultImeMode);
            Assert.Equal(new Padding(3), listView.DefaultMargin);
            Assert.Equal(Size.Empty, listView.DefaultMaximumSize);
            Assert.Equal(Size.Empty, listView.DefaultMinimumSize);
            Assert.Equal(Padding.Empty, listView.DefaultPadding);
            Assert.Equal(new Size(121, 97), listView.DefaultSize);
            Assert.False(listView.DesignMode);
            Assert.Equal(new Rectangle(0, 0, 117, 93), listView.DisplayRectangle);
            Assert.Equal(DockStyle.None, listView.Dock);
            Assert.False(listView.DoubleBuffered);
            Assert.True(listView.Enabled);
            Assert.NotNull(listView.Events);
            Assert.Same(listView.Events, listView.Events);
            Assert.Equal(Control.DefaultFont, listView.Font);
            Assert.Equal(listView.Font.Height, listView.FontHeight);
            Assert.Equal(SystemColors.WindowText, listView.ForeColor);
            Assert.False(listView.FullRowSelect);
            Assert.False(listView.GridLines);
            Assert.Empty(listView.Groups);
            Assert.Same(listView.Groups, listView.Groups);
            Assert.False(listView.HasChildren);
            Assert.Equal(ColumnHeaderStyle.Clickable, listView.HeaderStyle);
            Assert.Equal(97, listView.Height);
            Assert.False(listView.HideSelection);
            Assert.False(listView.HotTracking);
            Assert.False(listView.HoverSelection);
            Assert.Equal(ImeMode.NoControl, listView.ImeMode);
            Assert.Equal(ImeMode.NoControl, listView.ImeModeBase);
            Assert.NotNull(listView.InsertionMark);
            Assert.Same(listView.InsertionMark, listView.InsertionMark);
            Assert.Empty(listView.Items);
            Assert.Same(listView.Items, listView.Items);
            Assert.False(listView.LabelEdit);
            Assert.True(listView.LabelWrap);
            Assert.Null(listView.LargeImageList);
            Assert.Equal(0, listView.Left);
            Assert.Null(listView.ListViewItemSorter);
            Assert.Equal(Point.Empty, listView.Location);
            Assert.Equal(new Padding(3), listView.Margin);
            Assert.True(listView.MultiSelect);
            Assert.False(listView.OwnerDraw);
            Assert.Equal(Padding.Empty, listView.Padding);
            Assert.Null(listView.Parent);
            Assert.Equal("Microsoft\u00AE .NET", listView.ProductName);
            Assert.False(listView.RecreatingHandle);
            Assert.Null(listView.Region);
            Assert.False(listView.ResizeRedraw);
            Assert.Equal(121, listView.Right);
            Assert.Equal(RightToLeft.No, listView.RightToLeft);
            Assert.False(listView.RightToLeftLayout);
            Assert.True(listView.Scrollable);
            Assert.Empty(listView.SelectedIndices);
            Assert.Same(listView.SelectedIndices, listView.SelectedIndices);
            Assert.Empty(listView.SelectedItems);
            Assert.Same(listView.SelectedItems, listView.SelectedItems);
            Assert.True(listView.ShowGroups);
            Assert.False(listView.ShowItemToolTips);
            Assert.Null(listView.SmallImageList);
            Assert.Null(listView.Site);
            Assert.Equal(new Size(121, 97), listView.Size);
            Assert.Equal(SortOrder.None, listView.Sorting);
            Assert.Null(listView.StateImageList);
            Assert.Equal(0, listView.TabIndex);
            Assert.True(listView.TabStop);
            Assert.Empty(listView.Text);
            Assert.Equal(Size.Empty, listView.TileSize);
            Assert.Equal(0, listView.Top);
            Assert.Throws <InvalidOperationException>(() => listView.TopItem);
            Assert.True(listView.UseCompatibleStateImageBehavior);
            Assert.Equal(View.LargeIcon, listView.View);
            Assert.Equal(0, listView.VirtualListSize);
            Assert.False(listView.VirtualMode);
            Assert.True(listView.Visible);
            Assert.Equal(121, listView.Width);

            Assert.False(listView.IsHandleCreated);
        }