Skip to content

Commit b99a5de

Browse files
Update PopupPageTests.cs
1 parent 546a15c commit b99a5de

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/CommunityToolkit.Maui.UnitTests/Views/Popup/PopupPageTests.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,19 +221,20 @@ public void PopupPageT_Close_ShouldThrowOperationCanceledException_WhenTokenIsCa
221221
public void TapGestureRecognizer_VerifyCanBeDismissedByTappingOutsideOfPopup_ShouldNotExecuteWhenEitherFalse()
222222
{
223223
// Arrange
224-
var view = new Popup
225-
{
226-
CanBeDismissedByTappingOutsideOfPopup = false
227-
};
228-
var popupOptions = new PopupOptions
229-
{
230-
CanBeDismissedByTappingOutsideOfPopup = false
231-
};
224+
var view = new Popup();
225+
var popupOptions = new PopupOptions();
232226

233227
// Act
234228
var popupPage = new PopupPage(view, popupOptions);
235229
var tapGestureRecognizer = popupPage.Content.Children.OfType<BoxView>().Single().GestureRecognizers.OfType<TapGestureRecognizer>().Single();
236230

231+
// Assert
232+
Assert.True(tapGestureRecognizer.Command?.CanExecute(null));
233+
234+
// Act
235+
view.CanBeDismissedByTappingOutsideOfPopup = false;
236+
popupOptions.CanBeDismissedByTappingOutsideOfPopup = false;
237+
237238
// Assert
238239
Assert.False(tapGestureRecognizer.Command?.CanExecute(null));
239240

0 commit comments

Comments
 (0)