@@ -7304,6 +7304,96 @@ public void ToolStrip_GetNextItem_ItemsBackwardExpected(ToolStripLayoutStyle too
7304
7304
Assert . False ( toolStrip . IsHandleCreated ) ;
7305
7305
}
7306
7306
7307
+ [ WinFormsTheory ]
7308
+ [ InlineData ( 10 , 10 ) ]
7309
+ [ InlineData ( 0 , 0 ) ]
7310
+ [ InlineData ( - 10 , - 10 ) ]
7311
+ public void ToolStrip_GetChildAtPoint_WithoutSkipValue_Invoke_ReturnsExpected ( int x , int y )
7312
+ {
7313
+ using ToolStrip toolStrip = new ( ) ;
7314
+ var child = toolStrip . GetChildAtPoint ( new Point ( x , y ) ) ;
7315
+
7316
+ child . Should ( ) . BeNull ( ) ;
7317
+ }
7318
+
7319
+ [ WinFormsTheory ]
7320
+ [ InlineData ( GetChildAtPointSkip . None ) ]
7321
+ [ InlineData ( GetChildAtPointSkip . Disabled ) ]
7322
+ [ InlineData ( GetChildAtPointSkip . Invisible ) ]
7323
+ [ InlineData ( GetChildAtPointSkip . Transparent ) ]
7324
+ public void ToolStrip_GetChildAtPoint_WithSkipValue_Invoke_ReturnsExpected ( GetChildAtPointSkip skipValue )
7325
+ {
7326
+ using ToolStrip toolStrip = new ( ) ;
7327
+ var child = toolStrip . GetChildAtPoint ( new Point ( 10 , 10 ) , skipValue ) ;
7328
+
7329
+ child . Should ( ) . BeNull ( ) ;
7330
+ }
7331
+
7332
+ [ WinFormsFact ]
7333
+ public void ToolStrip_ResetMinimumSize_Invoke_Success ( )
7334
+ {
7335
+ using ToolStrip toolStrip = new ( ) ;
7336
+ Size oldSize = toolStrip . MinimumSize ;
7337
+
7338
+ toolStrip . ResetMinimumSize ( ) ;
7339
+
7340
+ oldSize . Should ( ) . NotBe ( toolStrip . MinimumSize ) ;
7341
+ toolStrip . MinimumSize . Should ( ) . Be ( new Size ( - 1 , - 1 ) ) ;
7342
+ }
7343
+
7344
+ [ WinFormsFact ]
7345
+ public void ToolStrip_ResetGripMargin_SetsGripMarginToDefault ( )
7346
+ {
7347
+ using ToolStrip toolStrip = new ( ) ;
7348
+ var defaultMargin = toolStrip . Grip . DefaultMargin ;
7349
+ toolStrip . GripMargin = new Padding ( 10 , 10 , 10 , 10 ) ;
7350
+
7351
+ toolStrip . TestAccessor ( ) . Dynamic . ResetGripMargin ( ) ;
7352
+
7353
+ toolStrip . GripMargin . Should ( ) . Be ( defaultMargin ) ;
7354
+ }
7355
+
7356
+ [ WinFormsFact ]
7357
+ public void ToolStrip_SetAutoScrollMargin_Invoke_Success ( )
7358
+ {
7359
+ using var toolStrip = new ToolStrip ( ) { AutoScrollMargin = new Size ( 10 , 20 ) } ;
7360
+
7361
+ toolStrip . AutoScrollMargin . Should ( ) . Be ( new Size ( 10 , 20 ) ) ;
7362
+ }
7363
+
7364
+ [ WinFormsFact ]
7365
+ public void ToolStrip_ShouldSerializeLayoutStyle_Invoke_ReturnsExpected ( )
7366
+ {
7367
+ using ToolStrip toolStrip = new ( ) ;
7368
+ toolStrip . ShouldSerializeLayoutStyle ( ) . Should ( ) . BeFalse ( ) ;
7369
+
7370
+ toolStrip . LayoutStyle = ToolStripLayoutStyle . Flow ;
7371
+ toolStrip . ShouldSerializeLayoutStyle ( ) . Should ( ) . BeTrue ( ) ;
7372
+
7373
+ toolStrip . LayoutStyle = ToolStripLayoutStyle . HorizontalStackWithOverflow ;
7374
+ toolStrip . ShouldSerializeLayoutStyle ( ) . Should ( ) . BeTrue ( ) ;
7375
+
7376
+ toolStrip . LayoutStyle = ToolStripLayoutStyle . VerticalStackWithOverflow ;
7377
+ toolStrip . ShouldSerializeLayoutStyle ( ) . Should ( ) . BeTrue ( ) ;
7378
+
7379
+ toolStrip . LayoutStyle = ToolStripLayoutStyle . Table ;
7380
+ toolStrip . ShouldSerializeLayoutStyle ( ) . Should ( ) . BeTrue ( ) ;
7381
+
7382
+ toolStrip . LayoutStyle = ToolStripLayoutStyle . StackWithOverflow ;
7383
+ toolStrip . ShouldSerializeLayoutStyle ( ) . Should ( ) . BeFalse ( ) ;
7384
+ }
7385
+
7386
+ [ WinFormsFact ]
7387
+ public void ToolStrip_ShouldSerializeGripMargin_Invoke_ReturnsExpected ( )
7388
+ {
7389
+ using ToolStrip toolStrip = new ( ) { GripMargin = new Padding ( 1 ) } ;
7390
+ ( ( bool ) toolStrip . TestAccessor ( ) . Dynamic . ShouldSerializeGripMargin ( ) ) . Should ( ) . BeTrue ( ) ;
7391
+
7392
+ var defaultGripMargin = ( Padding ) toolStrip . TestAccessor ( ) . Dynamic . DefaultGripMargin ;
7393
+ toolStrip . GripMargin = defaultGripMargin ;
7394
+ ( ( bool ) toolStrip . TestAccessor ( ) . Dynamic . ShouldSerializeGripMargin ( ) ) . Should ( ) . BeFalse ( ) ;
7395
+ }
7396
+
7307
7397
private class SubAxHost : AxHost
7308
7398
{
7309
7399
public SubAxHost ( string clsid ) : base ( clsid )
0 commit comments