@@ -184,6 +184,7 @@ public void ShowPopupAsync_WithViewType_ShowsPopup()
184184 public void ShowPopupAsync_WithViewType_SetsCorrectDefaults ( )
185185 {
186186 // Arrange
187+ Border popupBorder ;
187188 PopupPage popupPage ;
188189 Popup autogeneratedPopup ;
189190 var label = new Label ( ) ;
@@ -192,13 +193,16 @@ public void ShowPopupAsync_WithViewType_SetsCorrectDefaults()
192193 navigation . ShowPopup ( label ) ;
193194
194195 popupPage = ( PopupPage ) navigation . ModalStack [ 0 ] ;
196+ popupBorder = popupPage . Content . PopupBorder ;
195197 autogeneratedPopup = ( Popup ) ( popupPage . Content . PopupBorder . Content ?? throw new InvalidOperationException ( "Border Content cannot be null" ) ) ;
196198
197199 // Assert
198- Assert . Equal ( PopupDefaults . BackgroundColor , autogeneratedPopup . BackgroundColor ) ;
199- Assert . Equal ( PopupDefaults . HorizontalOptions , autogeneratedPopup . HorizontalOptions ) ;
200- Assert . Equal ( PopupDefaults . VerticalOptions , autogeneratedPopup . VerticalOptions ) ;
201- Assert . Equal ( PopupDefaults . Padding , autogeneratedPopup . Padding ) ;
200+ Assert . Equal ( new Thickness ( 30 ) , popupBorder . Margin ) ;
201+ Assert . Equal ( LayoutOptions . Center , popupBorder . VerticalOptions ) ;
202+ Assert . Equal ( LayoutOptions . Center , popupBorder . HorizontalOptions ) ;
203+ Assert . Equal ( new Thickness ( 15 ) , autogeneratedPopup . Padding ) ;
204+ Assert . Equal ( Colors . White , autogeneratedPopup . BackgroundColor ) ;
205+ Assert . True ( autogeneratedPopup . CanBeDismissedByTappingOutsideOfPopup ) ;
202206 }
203207
204208 [ Fact ]
@@ -465,7 +469,6 @@ public void ShowPopupAsync_WithCustomOptions_AppliesOptions()
465469 // Verify Border Bindings to Border
466470 Assert . Equal ( popup . BindingContext , border . BindingContext ) ;
467471 Assert . Equal ( popup . Margin , border . Margin ) ;
468- Assert . Equal ( ( ( IPaddingElement ) popup ) . Padding , border . Padding ) ;
469472 Assert . Equal ( popup . Background , border . Background ) ;
470473 Assert . Equal ( popup . BackgroundColor , border . BackgroundColor ) ;
471474 Assert . Equal ( popup . HorizontalOptions , border . HorizontalOptions ) ;
@@ -537,7 +540,6 @@ public void ShowPopupAsync_Shell_WithCustomOptions_AppliesOptions()
537540 // Verify Border Bindings to Border
538541 Assert . Equal ( popup . BindingContext , border . BindingContext ) ;
539542 Assert . Equal ( popup . Margin , border . Margin ) ;
540- Assert . Equal ( ( ( IPaddingElement ) popup ) . Padding , border . Padding ) ;
541543 Assert . Equal ( popup . Background , border . Background ) ;
542544 Assert . Equal ( popup . BackgroundColor , border . BackgroundColor ) ;
543545 Assert . Equal ( popup . HorizontalOptions , border . HorizontalOptions ) ;
@@ -563,6 +565,8 @@ public void ShowPopupAsyncWithView_WithCustomOptions_AppliesOptions()
563565
564566 var view = new Grid
565567 {
568+ Margin = 20 ,
569+ BackgroundColor = Colors . Orange ,
566570 HorizontalOptions = LayoutOptions . End ,
567571 VerticalOptions = LayoutOptions . Start ,
568572 } ;
@@ -606,10 +610,9 @@ public void ShowPopupAsyncWithView_WithCustomOptions_AppliesOptions()
606610 Assert . Equal ( view . VerticalOptions , border . VerticalOptions ) ;
607611 Assert . Equal ( view . HorizontalOptions , border . HorizontalOptions ) ;
608612
609- // Verify Border Bindings to Border
613+ // Verify Popup Bindings to Border
610614 Assert . Equal ( popup . BindingContext , border . BindingContext ) ;
611615 Assert . Equal ( popup . Margin , border . Margin ) ;
612- Assert . Equal ( ( ( IPaddingElement ) popup ) . Padding , border . Padding ) ;
613616 Assert . Equal ( popup . Background , border . Background ) ;
614617 Assert . Equal ( popup . BackgroundColor , border . BackgroundColor ) ;
615618 Assert . Equal ( popup . HorizontalOptions , border . HorizontalOptions ) ;
@@ -676,22 +679,17 @@ public void ShowPopupAsyncWithView_Shell_WithCustomOptions_AppliesOptions()
676679 Assert . Equal ( viewWithQueryable . Background , popup . Background ) ;
677680 Assert . Equal ( viewWithQueryable . BackgroundColor , popup . BackgroundColor ) ;
678681 Assert . Equal ( viewWithQueryable . Margin , popup . Margin ) ;
679- Assert . Equal ( viewWithQueryable . VerticalOptions , popup . VerticalOptions ) ;
680- Assert . Equal ( viewWithQueryable . HorizontalOptions , popup . HorizontalOptions ) ;
681682
682683 // Verify View options Binding to Border
683684 Assert . Equal ( viewWithQueryable . BindingContext , border . BindingContext ) ;
684685 Assert . Equal ( viewWithQueryable . Background , border . Background ) ;
685686 Assert . Equal ( viewWithQueryable . BackgroundColor , border . BackgroundColor ) ;
686- Assert . Equal ( viewWithQueryable . Padding , border . Padding ) ;
687- Assert . Equal ( viewWithQueryable . Margin , border . Margin ) ;
688687 Assert . Equal ( viewWithQueryable . VerticalOptions , border . VerticalOptions ) ;
689688 Assert . Equal ( viewWithQueryable . HorizontalOptions , border . HorizontalOptions ) ;
690689
691- // Verify Border Bindings to Border
690+ // Verify Border Bindings to Popup
692691 Assert . Equal ( popup . BindingContext , border . BindingContext ) ;
693692 Assert . Equal ( popup . Margin , border . Margin ) ;
694- Assert . Equal ( ( ( IPaddingElement ) popup ) . Padding , border . Padding ) ;
695693 Assert . Equal ( popup . Background , border . Background ) ;
696694 Assert . Equal ( popup . BackgroundColor , border . BackgroundColor ) ;
697695 Assert . Equal ( popup . HorizontalOptions , border . HorizontalOptions ) ;
0 commit comments