@@ -109,6 +109,7 @@ public void CanSetSingleOptionSelectedByText()
109
109
webElement . SetupGet < string > ( _ => _ . TagName ) . Returns ( "select" ) ;
110
110
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( "true" ) ;
111
111
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
112
+ option1 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
112
113
option1 . Setup ( _ => _ . Click ( ) ) ;
113
114
webElement . Setup ( _ => _ . FindElements ( It . IsAny < By > ( ) ) ) . Returns ( new ReadOnlyCollection < IWebElement > ( options ) ) . Verifiable ( ) ;
114
115
@@ -128,6 +129,7 @@ public void CanSetSingleOptionSelectedByValue()
128
129
webElement . SetupGet < string > ( _ => _ . TagName ) . Returns ( "select" ) ;
129
130
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( ( string ) null ) ;
130
131
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
132
+ option1 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
131
133
option1 . Setup ( _ => _ . Click ( ) ) ;
132
134
webElement . Setup ( _ => _ . FindElements ( It . IsAny < By > ( ) ) ) . Returns ( new ReadOnlyCollection < IWebElement > ( options ) ) . Verifiable ( ) ;
133
135
@@ -148,6 +150,7 @@ public void CanSetSingleOptionSelectedByIndex()
148
150
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( ( string ) null ) ;
149
151
option1 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "2" ) ;
150
152
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
153
+ option1 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
151
154
option1 . Setup ( _ => _ . Click ( ) ) ;
152
155
webElement . Setup ( _ => _ . FindElements ( It . IsAny < By > ( ) ) ) . Returns ( new ReadOnlyCollection < IWebElement > ( options ) ) . Verifiable ( ) ;
153
156
@@ -170,8 +173,10 @@ public void CanSetMultipleOptionSelectedByText()
170
173
webElement . SetupGet < string > ( _ => _ . TagName ) . Returns ( "select" ) ;
171
174
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( "true" ) ;
172
175
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
176
+ option1 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
173
177
option1 . Setup ( _ => _ . Click ( ) ) ;
174
178
option2 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
179
+ option2 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
175
180
option2 . Setup ( _ => _ . Click ( ) ) ;
176
181
webElement . Setup ( _ => _ . FindElements ( It . IsAny < By > ( ) ) ) . Returns ( new ReadOnlyCollection < IWebElement > ( options ) ) . Verifiable ( ) ;
177
182
@@ -195,8 +200,10 @@ public void CanSetMultipleOptionSelectedByValue()
195
200
webElement . SetupGet < string > ( _ => _ . TagName ) . Returns ( "select" ) ;
196
201
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( "true" ) ;
197
202
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
203
+ option1 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
198
204
option1 . Setup ( _ => _ . Click ( ) ) ;
199
205
option2 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
206
+ option2 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
200
207
option2 . Setup ( _ => _ . Click ( ) ) ;
201
208
webElement . Setup ( _ => _ . FindElements ( It . IsAny < By > ( ) ) ) . Returns ( new ReadOnlyCollection < IWebElement > ( options ) ) . Verifiable ( ) ;
202
209
@@ -219,17 +226,19 @@ public void CanSetMultipleOptionSelectedByIndex()
219
226
220
227
webElement . SetupGet < string > ( _ => _ . TagName ) . Returns ( "select" ) ;
221
228
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( "true" ) ;
222
- option1 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "2 " ) ;
229
+ option1 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "1 " ) ;
223
230
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
231
+ option1 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
224
232
option1 . Setup ( _ => _ . Click ( ) ) ;
225
233
option2 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "2" ) ;
226
234
option2 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( false ) ;
235
+ option2 . SetupGet < bool > ( _ => _ . Enabled ) . Returns ( true ) ;
227
236
option2 . Setup ( _ => _ . Click ( ) ) ;
228
237
webElement . Setup ( _ => _ . FindElements ( It . IsAny < By > ( ) ) ) . Returns ( new ReadOnlyCollection < IWebElement > ( options ) ) . Verifiable ( ) ;
229
238
230
239
new SelectElement ( webElement . Object ) . SelectByIndex ( 2 ) ;
231
- option1 . Verify ( _ => _ . Selected , Times . Once ) ;
232
- option1 . Verify ( _ => _ . Click ( ) , Times . Once ) ;
240
+ option1 . Verify ( _ => _ . Selected , Times . Never ) ;
241
+ option1 . Verify ( _ => _ . Click ( ) , Times . Never ) ;
233
242
option1 . Verify ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) , Times . Once ) ;
234
243
option2 . Verify ( _ => _ . Selected , Times . Once ) ;
235
244
option2 . Verify ( _ => _ . Click ( ) , Times . Once ) ;
@@ -352,7 +361,7 @@ public void CanDeselectMultipleOptionSelectedByIndex()
352
361
353
362
webElement . SetupGet < string > ( _ => _ . TagName ) . Returns ( "select" ) ;
354
363
webElement . Setup ( _ => _ . GetAttribute ( It . Is < string > ( x => x == "multiple" ) ) ) . Returns ( "true" ) ;
355
- option1 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "2 " ) ;
364
+ option1 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "1 " ) ;
356
365
option1 . SetupGet < bool > ( _ => _ . Selected ) . Returns ( true ) ;
357
366
option1 . Setup ( _ => _ . Click ( ) ) ;
358
367
option2 . Setup < string > ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) ) . Returns ( "2" ) ;
@@ -362,8 +371,8 @@ public void CanDeselectMultipleOptionSelectedByIndex()
362
371
363
372
new SelectElement ( webElement . Object ) . DeselectByIndex ( 2 ) ;
364
373
option1 . Verify ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) , Times . Once ) ;
365
- option1 . Verify ( _ => _ . Selected , Times . Once ) ;
366
- option1 . Verify ( _ => _ . Click ( ) , Times . Once ) ;
374
+ option1 . Verify ( _ => _ . Selected , Times . Never ) ;
375
+ option1 . Verify ( _ => _ . Click ( ) , Times . Never ) ;
367
376
option2 . Verify ( _ => _ . GetAttribute ( It . IsAny < string > ( ) ) , Times . Once ) ;
368
377
option2 . Verify ( _ => _ . Selected , Times . Once ) ;
369
378
option2 . Verify ( _ => _ . Click ( ) , Times . Once ) ;
0 commit comments