@@ -68,6 +68,58 @@ public async Task ClosePopup_PopupBlocked_ShouldThrowPopupBlockedException()
6868 await Assert . ThrowsAsync < PopupBlockedException > ( ( ) => navigation . ClosePopupAsync ( TestContext . Current . CancellationToken ) ) ;
6969 }
7070
71+ [ Fact ( Timeout = ( int ) TestDuration . Short ) ]
72+ public async Task ClosePopup_NullPage_ShouldThrowArgumentNullException ( )
73+ {
74+ // Arrange
75+
76+ // Act
77+
78+ // Assert
79+ #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
80+ await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => PopupExtensions . ClosePopupAsync ( ( Page ? ) null , TestContext . Current . CancellationToken ) ) ;
81+ #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
82+ }
83+
84+ [ Fact ( Timeout = ( int ) TestDuration . Short ) ]
85+ public async Task ClosePopup_NullNavigation_ShouldThrowArgumentNullException ( )
86+ {
87+ // Arrange
88+
89+ // Act
90+
91+ // Assert
92+ #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
93+ await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => PopupExtensions . ClosePopupAsync ( ( INavigation ? ) null , TestContext . Current . CancellationToken ) ) ;
94+ #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
95+ }
96+
97+ [ Fact ( Timeout = ( int ) TestDuration . Short ) ]
98+ public async Task ClosePopupT_NullPage_ShouldThrowArgumentNullException ( )
99+ {
100+ // Arrange
101+
102+ // Act
103+
104+ // Assert
105+ #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
106+ await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => PopupExtensions . ClosePopupAsync ( ( Page ? ) null , 2 , TestContext . Current . CancellationToken ) ) ;
107+ #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
108+ }
109+
110+ [ Fact ( Timeout = ( int ) TestDuration . Short ) ]
111+ public async Task ClosePopupT_NullNavigation_ShouldThrowArgumentNullException ( )
112+ {
113+ // Arrange
114+
115+ // Act
116+
117+ // Assert
118+ #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
119+ await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => PopupExtensions . ClosePopupAsync ( ( INavigation ? ) null , 2 , TestContext . Current . CancellationToken ) ) ;
120+ #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type.
121+ }
122+
71123 [ Fact ( Timeout = ( int ) TestDuration . Short ) ]
72124 public async Task ShowPopupAsync_WithPopupType_ShowsPopupAndClosesPopup ( )
73125 {
0 commit comments