Skip to content

Commit bcde363

Browse files
committed
Mocks for multiple
1 parent 120cc8b commit bcde363

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

dotnet/test/support/UI/SelectTests.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public void ThrowUnexpectedTagNameExceptionWhenNotSelectTag()
5050
public void CanCreateNewInstanceOfSelectWithNormalSelectElement()
5151
{
5252
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
53-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns((string)null);
53+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns((string)null);
5454

5555
Assert.That(new SelectElement(webElement.Object).IsMultiple, Is.False);
5656
}
@@ -59,7 +59,7 @@ public void CanCreateNewInstanceOfSelectWithNormalSelectElement()
5959
public void CanCreateNewInstanceOfSelectWithMultipleSelectElement()
6060
{
6161
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
62-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
62+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
6363

6464
Assert.That(new SelectElement(webElement.Object).IsMultiple, Is.True);
6565
}
@@ -69,7 +69,7 @@ public void CanGetListOfOptions()
6969
{
7070
IList<IWebElement> options = new List<IWebElement>();
7171
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
72-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
72+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
7373
webElement.Setup(_ => _.FindElements(It.IsAny<By>())).Returns(new ReadOnlyCollection<IWebElement>(options));
7474

7575
Assert.That(new SelectElement(webElement.Object).Options, Is.EqualTo(options));
@@ -85,7 +85,7 @@ public void CanGetSingleSelectedOption()
8585
options.Add(selected.Object);
8686

8787
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
88-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
88+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
8989
notSelected.SetupGet<bool>(_ => _.Selected).Returns(false);
9090
selected.SetupGet<bool>(_ => _.Selected).Returns(true);
9191
webElement.Setup(_ => _.FindElements(It.IsAny<By>())).Returns(new ReadOnlyCollection<IWebElement>(options)).Verifiable();
@@ -107,7 +107,7 @@ public void CanGetAllSelectedOptions()
107107
options.Add(notSelected.Object);
108108

109109
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
110-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
110+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
111111
notSelected.SetupGet<bool>(_ => _.Selected).Returns(false);
112112
selected.SetupGet<bool>(_ => _.Selected).Returns(true);
113113
webElement.Setup(_ => _.FindElements(It.IsAny<By>())).Returns(new ReadOnlyCollection<IWebElement>(options)).Verifiable();
@@ -128,7 +128,7 @@ public void CanSetSingleOptionSelectedByText()
128128
options.Add(option1.Object);
129129

130130
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
131-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
131+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
132132
option1.SetupGet<bool>(_ => _.Selected).Returns(false);
133133
option1.SetupGet<bool>(_ => _.Enabled).Returns(true);
134134
option1.Setup(_ => _.Click());
@@ -148,7 +148,7 @@ public void CanSetSingleOptionSelectedByValue()
148148
options.Add(option1.Object);
149149

150150
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
151-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns((string)null);
151+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns((string)null);
152152
option1.SetupGet<bool>(_ => _.Selected).Returns(false);
153153
option1.SetupGet<bool>(_ => _.Enabled).Returns(true);
154154
option1.Setup(_ => _.Click());
@@ -168,7 +168,7 @@ public void CanSetSingleOptionSelectedByIndex()
168168
options.Add(option1.Object);
169169

170170
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
171-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns((string)null);
171+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns((string)null);
172172
option1.Setup<string>(_ => _.GetAttribute(It.IsAny<string>())).Returns("2");
173173
option1.SetupGet<bool>(_ => _.Selected).Returns(false);
174174
option1.SetupGet<bool>(_ => _.Enabled).Returns(true);
@@ -192,7 +192,7 @@ public void CanSetMultipleOptionSelectedByText()
192192
options.Add(option2.Object);
193193

194194
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
195-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
195+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
196196
option1.SetupGet<bool>(_ => _.Selected).Returns(false);
197197
option1.SetupGet<bool>(_ => _.Enabled).Returns(true);
198198
option1.Setup(_ => _.Click());
@@ -219,7 +219,7 @@ public void CanSetMultipleOptionSelectedByValue()
219219
options.Add(option2.Object);
220220

221221
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
222-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
222+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
223223
option1.SetupGet<bool>(_ => _.Selected).Returns(false);
224224
option1.SetupGet<bool>(_ => _.Enabled).Returns(true);
225225
option1.Setup(_ => _.Click());
@@ -246,7 +246,7 @@ public void CanSetMultipleOptionSelectedByIndex()
246246
options.Add(option2.Object);
247247

248248
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
249-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
249+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
250250
option1.Setup<string>(_ => _.GetAttribute(It.IsAny<string>())).Returns("1");
251251
option1.SetupGet<bool>(_ => _.Selected).Returns(false);
252252
option1.SetupGet<bool>(_ => _.Enabled).Returns(true);
@@ -275,7 +275,7 @@ public void CanDeselectSingleOptionSelectedByText()
275275
options.Add(option1.Object);
276276

277277
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
278-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
278+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
279279
option1.SetupGet<bool>(_ => _.Selected).Returns(true);
280280
option1.Setup(_ => _.Click());
281281
webElement.Setup(_ => _.FindElements(It.IsAny<By>())).Returns(new ReadOnlyCollection<IWebElement>(options)).Verifiable();
@@ -294,7 +294,7 @@ public void CanDeselectSingleOptionSelectedByValue()
294294
options.Add(option1.Object);
295295

296296
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
297-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
297+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
298298
option1.SetupGet<bool>(_ => _.Selected).Returns(true);
299299
option1.Setup(_ => _.Click());
300300
webElement.Setup(_ => _.FindElements(It.IsAny<By>())).Returns(new ReadOnlyCollection<IWebElement>(options)).Verifiable();
@@ -313,7 +313,7 @@ public void CanDeselectSingleOptionSelectedByIndex()
313313
options.Add(option1.Object);
314314

315315
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
316-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
316+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
317317
option1.Setup<string>(_ => _.GetAttribute(It.IsAny<string>())).Returns("2");
318318
option1.SetupGet<bool>(_ => _.Selected).Returns(true);
319319
option1.Setup(_ => _.Click());
@@ -336,7 +336,7 @@ public void CanDeselectMultipleOptionSelectedByText()
336336
options.Add(option2.Object);
337337

338338
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
339-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
339+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
340340
option1.SetupGet<bool>(_ => _.Selected).Returns(true);
341341
option1.Setup(_ => _.Click());
342342
option2.SetupGet<bool>(_ => _.Selected).Returns(true);
@@ -356,7 +356,7 @@ public void CanDeselectMultipleOptionSelectedByValue()
356356
options.Add(option2.Object);
357357

358358
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
359-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
359+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
360360
option1.SetupGet<bool>(_ => _.Selected).Returns(true);
361361
option1.Setup(_ => _.Click());
362362
option2.SetupGet<bool>(_ => _.Selected).Returns(true);
@@ -381,7 +381,7 @@ public void CanDeselectMultipleOptionSelectedByIndex()
381381
options.Add(option2.Object);
382382

383383
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
384-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
384+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
385385
option1.Setup<string>(_ => _.GetAttribute(It.IsAny<string>())).Returns("1");
386386
option1.SetupGet<bool>(_ => _.Selected).Returns(true);
387387
option1.Setup(_ => _.Click());
@@ -409,7 +409,7 @@ public void SelectedOptionPropertyShouldThrowExceptionWhenNoOptionSelected()
409409
options.Add(notSelected.Object);
410410

411411
webElement.SetupGet<string>(_ => _.TagName).Returns("select");
412-
webElement.Setup(_ => _.GetAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
412+
webElement.Setup(_ => _.GetDomAttribute(It.Is<string>(x => x == "multiple"))).Returns("true");
413413
notSelected.SetupGet<bool>(_ => _.Selected).Returns(false);
414414
webElement.Setup(_ => _.FindElements(It.IsAny<By>())).Returns(new ReadOnlyCollection<IWebElement>(options)).Verifiable();
415415

0 commit comments

Comments
 (0)