@@ -7,31 +7,28 @@ namespace ElectronNET.IntegrationTests.Tests
77 using ElectronNET . IntegrationTests . Common ;
88
99 [ Collection ( "ElectronCollection" ) ]
10- public class BrowserWindowTests
10+ public class BrowserWindowTests : IntegrationTestBase
1111 {
12- private readonly ElectronFixture fx ;
13-
14- public BrowserWindowTests ( ElectronFixture fx )
12+ public BrowserWindowTests ( ElectronFixture fx ) : base ( fx )
1513 {
16- this . fx = fx ;
1714 }
1815
1916 [ IntegrationFact ]
2017 public async Task Can_set_and_get_title ( )
2118 {
2219 const string title = "Integration Test Title" ;
23- this . fx . MainWindow . SetTitle ( title ) ;
20+ this . MainWindow . SetTitle ( title ) ;
2421 await Task . Delay ( 500 . ms ( ) ) ;
25- var roundTrip = await this . fx . MainWindow . GetTitleAsync ( ) ;
22+ var roundTrip = await this . MainWindow . GetTitleAsync ( ) ;
2623 roundTrip . Should ( ) . Be ( title ) ;
2724 }
2825
2926 [ IntegrationFact ]
3027 public async Task Can_resize_and_get_size ( )
3128 {
32- this . fx . MainWindow . SetSize ( 643 , 482 ) ;
29+ this . MainWindow . SetSize ( 643 , 482 ) ;
3330 await Task . Delay ( 500 . ms ( ) ) ;
34- var size = await this . fx . MainWindow . GetSizeAsync ( ) ;
31+ var size = await this . MainWindow . GetSizeAsync ( ) ;
3532 size . Should ( ) . HaveCount ( 2 ) ;
3633 size [ 0 ] . Should ( ) . Be ( 643 ) ;
3734 size [ 1 ] . Should ( ) . Be ( 482 ) ;
@@ -40,28 +37,28 @@ public async Task Can_resize_and_get_size()
4037 [ IntegrationFact ]
4138 public async Task Can_set_progress_bar_and_clear ( )
4239 {
43- this . fx . MainWindow . SetProgressBar ( 0.5 ) ;
40+ this . MainWindow . SetProgressBar ( 0.5 ) ;
4441 // No direct getter; rely on absence of error. Try changing again.
45- this . fx . MainWindow . SetProgressBar ( - 1 ) ; // clears
42+ this . MainWindow . SetProgressBar ( - 1 ) ; // clears
4643 await Task . Delay ( 50 . ms ( ) ) ;
4744 }
4845
4946 [ IntegrationFact ( SkipOnWsl = true ) ]
5047 public async Task Can_set_and_get_position ( )
5148 {
52- this . fx . MainWindow . SetPosition ( 134 , 246 ) ;
49+ this . MainWindow . SetPosition ( 134 , 246 ) ;
5350 await Task . Delay ( 500 . ms ( ) ) ;
54- var pos = await this . fx . MainWindow . GetPositionAsync ( ) ;
51+ var pos = await this . MainWindow . GetPositionAsync ( ) ;
5552 pos . Should ( ) . BeEquivalentTo ( [ 134 , 246 ] ) ;
5653 }
5754
5855 [ IntegrationFact ]
5956 public async Task Can_set_and_get_bounds ( )
6057 {
6158 var bounds = new Rectangle { X = 10 , Y = 20 , Width = 400 , Height = 300 } ;
62- this . fx . MainWindow . SetBounds ( bounds ) ;
59+ this . MainWindow . SetBounds ( bounds ) ;
6360 await Task . Delay ( 500 . ms ( ) ) ;
64- var round = await this . fx . MainWindow . GetBoundsAsync ( ) ;
61+ var round = await this . MainWindow . GetBoundsAsync ( ) ;
6562
6663 round . Should ( ) . BeEquivalentTo ( bounds ) ;
6764 round . Width . Should ( ) . Be ( 400 ) ;
@@ -72,9 +69,9 @@ public async Task Can_set_and_get_bounds()
7269 public async Task Can_set_and_get_content_bounds ( )
7370 {
7471 var bounds = new Rectangle { X = 0 , Y = 0 , Width = 300 , Height = 200 } ;
75- this . fx . MainWindow . SetContentBounds ( bounds ) ;
72+ this . MainWindow . SetContentBounds ( bounds ) ;
7673 await Task . Delay ( 500 . ms ( ) ) ;
77- var round = await this . fx . MainWindow . GetContentBoundsAsync ( ) ;
74+ var round = await this . MainWindow . GetContentBoundsAsync ( ) ;
7875 round . Width . Should ( ) . BeGreaterThan ( 0 ) ;
7976 round . Height . Should ( ) . BeGreaterThan ( 0 ) ;
8077 }
@@ -109,28 +106,28 @@ public async Task Show_hide_visibility_roundtrip()
109106 [ IntegrationFact ]
110107 public async Task AlwaysOnTop_toggle_and_query ( )
111108 {
112- this . fx . MainWindow . SetAlwaysOnTop ( true ) ;
109+ this . MainWindow . SetAlwaysOnTop ( true ) ;
113110 await Task . Delay ( 500 . ms ( ) ) ;
114- ( await this . fx . MainWindow . IsAlwaysOnTopAsync ( ) ) . Should ( ) . BeTrue ( ) ;
115- this . fx . MainWindow . SetAlwaysOnTop ( false ) ;
111+ ( await this . MainWindow . IsAlwaysOnTopAsync ( ) ) . Should ( ) . BeTrue ( ) ;
112+ this . MainWindow . SetAlwaysOnTop ( false ) ;
116113 await Task . Delay ( 500 . ms ( ) ) ;
117- ( await this . fx . MainWindow . IsAlwaysOnTopAsync ( ) ) . Should ( ) . BeFalse ( ) ;
114+ ( await this . MainWindow . IsAlwaysOnTopAsync ( ) ) . Should ( ) . BeFalse ( ) ;
118115 }
119116
120117 [ IntegrationFact ]
121- [ SupportedOSPlatform ( " Linux" ) ]
122- [ SupportedOSPlatform ( " Windows" ) ]
118+ [ SupportedOSPlatform ( Linux ) ]
119+ [ SupportedOSPlatform ( Windows ) ]
123120 public async Task MenuBar_auto_hide_and_visibility ( )
124121 {
125- this . fx . MainWindow . SetAutoHideMenuBar ( true ) ;
122+ this . MainWindow . SetAutoHideMenuBar ( true ) ;
126123 await Task . Delay ( 500 . ms ( ) ) ;
127- ( await this . fx . MainWindow . IsMenuBarAutoHideAsync ( ) ) . Should ( ) . BeTrue ( ) ;
128- this . fx . MainWindow . SetMenuBarVisibility ( false ) ;
124+ ( await this . MainWindow . IsMenuBarAutoHideAsync ( ) ) . Should ( ) . BeTrue ( ) ;
125+ this . MainWindow . SetMenuBarVisibility ( false ) ;
129126 await Task . Delay ( 500 . ms ( ) ) ;
130- ( await this . fx . MainWindow . IsMenuBarVisibleAsync ( ) ) . Should ( ) . BeFalse ( ) ;
131- this . fx . MainWindow . SetMenuBarVisibility ( true ) ;
127+ ( await this . MainWindow . IsMenuBarVisibleAsync ( ) ) . Should ( ) . BeFalse ( ) ;
128+ this . MainWindow . SetMenuBarVisibility ( true ) ;
132129 await Task . Delay ( 500 . ms ( ) ) ;
133- ( await this . fx . MainWindow . IsMenuBarVisibleAsync ( ) ) . Should ( ) . BeTrue ( ) ;
130+ ( await this . MainWindow . IsMenuBarVisibleAsync ( ) ) . Should ( ) . BeTrue ( ) ;
134131 }
135132
136133 [ IntegrationFact ]
@@ -196,7 +193,7 @@ public async Task Resize_event_fires_on_size_change()
196193 [ IntegrationFact ]
197194 public async Task Progress_bar_and_always_on_top_toggle ( )
198195 {
199- var win = this . fx . MainWindow ;
196+ var win = this . MainWindow ;
200197 win . SetProgressBar ( 0.5 ) ;
201198 await Task . Delay ( 50 . ms ( ) ) ;
202199 win . SetProgressBar ( 0.8 , new ProgressBarOptions ( ) ) ;
@@ -210,11 +207,11 @@ public async Task Progress_bar_and_always_on_top_toggle()
210207 }
211208
212209 [ IntegrationFact ]
213- [ SupportedOSPlatform ( " Linux" ) ]
214- [ SupportedOSPlatform ( " Windows" ) ]
210+ [ SupportedOSPlatform ( Linux ) ]
211+ [ SupportedOSPlatform ( Windows ) ]
215212 public async Task Menu_bar_visibility_and_auto_hide ( )
216213 {
217- var win = this . fx . MainWindow ;
214+ var win = this . MainWindow ;
218215 win . SetAutoHideMenuBar ( true ) ;
219216 await Task . Delay ( 500 . ms ( ) ) ;
220217 ( await win . IsMenuBarAutoHideAsync ( ) ) . Should ( ) . BeTrue ( ) ;
@@ -227,21 +224,21 @@ public async Task Menu_bar_visibility_and_auto_hide()
227224 public async Task Parent_child_relationship_roundtrip ( )
228225 {
229226 var child = await Electron . WindowManager . CreateWindowAsync ( new BrowserWindowOptions { Show = false , Width = 300 , Height = 200 } , "about:blank" ) ;
230- this . fx . MainWindow . SetParentWindow ( null ) ; // ensure top-level
231- child . SetParentWindow ( this . fx . MainWindow ) ;
227+ this . MainWindow . SetParentWindow ( null ) ; // ensure top-level
228+ child . SetParentWindow ( this . MainWindow ) ;
232229 await Task . Delay ( 500 . ms ( ) ) ;
233230 var parent = await child . GetParentWindowAsync ( ) ;
234- parent . Id . Should ( ) . Be ( this . fx . MainWindow . Id ) ;
235- var kids = await this . fx . MainWindow . GetChildWindowsAsync ( ) ;
231+ parent . Id . Should ( ) . Be ( this . MainWindow . Id ) ;
232+ var kids = await this . MainWindow . GetChildWindowsAsync ( ) ;
236233 kids . Select ( k => k . Id ) . Should ( ) . Contain ( child . Id ) ;
237234 child . Destroy ( ) ;
238235 }
239236
240237 [ IntegrationFact ]
241- [ SupportedOSPlatform ( "macOS" ) ]
238+ [ SupportedOSPlatform ( MacOS ) ]
242239 public async Task Represented_filename_and_edited_flags ( )
243240 {
244- var win = this . fx . MainWindow ;
241+ var win = this . MainWindow ;
245242 var temp = Path . Combine ( Path . GetTempPath ( ) , "electronnet_test.txt" ) ;
246243 File . WriteAllText ( temp , "test" ) ;
247244 win . SetRepresentedFilename ( temp ) ;
0 commit comments