63 references to _designer
System.Windows.Forms.Design.Tests (63)
ControlDesignerTests.cs (63)
20_designer.Dispose(); 69_designer.GetAccessibleObjectField().Should().BeNull(); 70_designer.GetBehaviorServiceProperty().Should().BeNull(); 71_designer.AccessibilityObject.Should().NotBeNull(); 72_designer.GetEnableDragRectProperty().Should().BeFalse(); 73_designer.ParticipatesWithSnapLines.Should().BeTrue(); 74_designer.AutoResizeHandles.Should().BeFalse(); 75_designer.GetInheritanceAttributeProperty().Should().NotBeNull(); 76_designer.NumberOfInternalControlDesigners().Should().Be(0); 77_designer.GetHitTestMethod(default).Should().BeFalse(); 78_designer.HookChildControlsMethod(_designer._control); 84_designer.AutoResizeHandles = true; 85_designer.AutoResizeHandles.Should().BeTrue(); 96_designer._control.Dock = dockStyle; 97SelectionRules finalSelectionRules = _designer.SelectionRules; 104_designer.SelectionRules.Should().Be(finalSelectionRules); 113_designer.BaseWndProcMethod(ref m); 126_designer.CanBeParentedTo(parentDesigner).Should().BeTrue(); 133Action action = () => _designer.EnableDragDropMethod(val); 167Action action = _designer.OnSetComponentDefaults; 175Action action = () => _designer.OnContextMenuMethod(0, 0); 182Action action = _designer.OnCreateHandleMethod; 192_designer.TestAccessor().Dynamic.WndProc(ref m); 203_designer.AssociatedComponents.Count.Should().Be(0); 205_designer._control.Controls.Add(childControl); 207_designer.AssociatedComponents.Count.Should().Be(0); 213var mockSite = MockSite.CreateMockSiteWithDesignerHost(_designer._mockDesignerHost.Object); 214_designer._control.Site = mockSite.Object; 216_designer.AssociatedComponents.Count.Should().Be(0); 220_designer._control.Controls.Add(childControl); 222_designer.AssociatedComponents.Count.Should().Be(1); 231Mock<DesignerFrame> mockDesignerFrame = new(_designer._control.Site!) { CallBase = true }; 234_designer.TestAccessor().Dynamic._behaviorService = behaviorService; 235_designer.TestAccessor().Dynamic.Locked = true; 237GlyphCollection glyphs = _designer.GetGlyphs(GlyphSelectionType.SelectedPrimary); 247GlyphCollection glyphs = _designer.GetGlyphs(GlyphSelectionType.NotSelected); 255_designer.TestAccessor().Dynamic._behaviorService = null; 257Action action = () => _designer.GetGlyphs(GlyphSelectionType.SelectedPrimary); 264_designer._control.Dock = DockStyle.Fill; 265_designer._control.AutoSize = false; 267Mock<DesignerFrame> mockDesignerFrame = new(_designer._mockSite.Object) { CallBase = true }; 270_designer._mockSite.Setup(s => s.GetService(typeof(BehaviorService))).Returns(behaviorService); 272_designer.TestAccessor().Dynamic._behaviorService = behaviorService; 274GlyphCollection glyphs = _designer.GetGlyphs(GlyphSelectionType.SelectedPrimary); 291_designer._control.Dock = DockStyle.None; 292_designer._control.AutoSize = false; 296_designer._mockSite.Setup(s => s.GetService(typeof(IServiceProvider))).Returns(mockServiceProvider.Object); 298Mock<DesignerFrame> mockDesignerFrame = new(_designer._mockSite.Object) { CallBase = true }; 301_designer.TestAccessor().Dynamic._behaviorService = behaviorService; 303GlyphCollection glyphs = _designer.GetGlyphs(GlyphSelectionType.SelectedPrimary); 333TypeDescriptor.AddAttributes(_designer._control, new DockingAttribute(dockingBehavior)); 336_designer._mockDesignerHost.Setup(h => h.GetDesigner(It.IsAny<IComponent>())).Returns(mockParentDesigner.Object); 343_designer.InitializeNewComponent(defaultValues); 345PropertyDescriptor? dockPropDescriptor = TypeDescriptor.GetProperties(_designer._control)[nameof(Control.Dock)]; 348dockPropDescriptor?.GetValue(_designer._control).Should().Be(dockStyle); 354TypeDescriptor.AddAttributes(_designer._control, new DockingAttribute(DockingBehavior.AutoDock)); 357_designer._mockDesignerHost.Setup(h => h.GetDesigner(It.IsAny<IComponent>())).Returns(mockParentDesigner.Object); 363Action action = () => _designer.InitializeExistingComponent(defaultValues); 371var msg = Message.Create(_designer._control.Handle, 0x0202, IntPtr.Zero, IntPtr.Zero); 373_designer.WndProc(ref msg); 375_designer.OnMouseDragEndCalled.Should().BeTrue(); 377bool _ctrlSelect = (bool)_designer.TestAccessor().Dynamic._ctrlSelect;