From bcde363ea857e6bb1408c7b028d8eafd809823b2 Mon Sep 17 00:00:00 2001 From: Nikolay Borisenko <22616990+nvborisenko@users.noreply.github.com> Date: Sat, 7 Dec 2024 21:53:10 +0300 Subject: [PATCH] Mocks for multiple --- dotnet/test/support/UI/SelectTests.cs | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/dotnet/test/support/UI/SelectTests.cs b/dotnet/test/support/UI/SelectTests.cs index d4966e29aea6c..9ad8c6618f7d6 100644 --- a/dotnet/test/support/UI/SelectTests.cs +++ b/dotnet/test/support/UI/SelectTests.cs @@ -50,7 +50,7 @@ public void ThrowUnexpectedTagNameExceptionWhenNotSelectTag() public void CanCreateNewInstanceOfSelectWithNormalSelectElement() { webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns((string)null); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns((string)null); Assert.That(new SelectElement(webElement.Object).IsMultiple, Is.False); } @@ -59,7 +59,7 @@ public void CanCreateNewInstanceOfSelectWithNormalSelectElement() public void CanCreateNewInstanceOfSelectWithMultipleSelectElement() { webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); Assert.That(new SelectElement(webElement.Object).IsMultiple, Is.True); } @@ -69,7 +69,7 @@ public void CanGetListOfOptions() { IList options = new List(); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); webElement.Setup(_ => _.FindElements(It.IsAny())).Returns(new ReadOnlyCollection(options)); Assert.That(new SelectElement(webElement.Object).Options, Is.EqualTo(options)); @@ -85,7 +85,7 @@ public void CanGetSingleSelectedOption() options.Add(selected.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); notSelected.SetupGet(_ => _.Selected).Returns(false); selected.SetupGet(_ => _.Selected).Returns(true); webElement.Setup(_ => _.FindElements(It.IsAny())).Returns(new ReadOnlyCollection(options)).Verifiable(); @@ -107,7 +107,7 @@ public void CanGetAllSelectedOptions() options.Add(notSelected.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); notSelected.SetupGet(_ => _.Selected).Returns(false); selected.SetupGet(_ => _.Selected).Returns(true); webElement.Setup(_ => _.FindElements(It.IsAny())).Returns(new ReadOnlyCollection(options)).Verifiable(); @@ -128,7 +128,7 @@ public void CanSetSingleOptionSelectedByText() options.Add(option1.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(false); option1.SetupGet(_ => _.Enabled).Returns(true); option1.Setup(_ => _.Click()); @@ -148,7 +148,7 @@ public void CanSetSingleOptionSelectedByValue() options.Add(option1.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns((string)null); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns((string)null); option1.SetupGet(_ => _.Selected).Returns(false); option1.SetupGet(_ => _.Enabled).Returns(true); option1.Setup(_ => _.Click()); @@ -168,7 +168,7 @@ public void CanSetSingleOptionSelectedByIndex() options.Add(option1.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns((string)null); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns((string)null); option1.Setup(_ => _.GetAttribute(It.IsAny())).Returns("2"); option1.SetupGet(_ => _.Selected).Returns(false); option1.SetupGet(_ => _.Enabled).Returns(true); @@ -192,7 +192,7 @@ public void CanSetMultipleOptionSelectedByText() options.Add(option2.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(false); option1.SetupGet(_ => _.Enabled).Returns(true); option1.Setup(_ => _.Click()); @@ -219,7 +219,7 @@ public void CanSetMultipleOptionSelectedByValue() options.Add(option2.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(false); option1.SetupGet(_ => _.Enabled).Returns(true); option1.Setup(_ => _.Click()); @@ -246,7 +246,7 @@ public void CanSetMultipleOptionSelectedByIndex() options.Add(option2.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.Setup(_ => _.GetAttribute(It.IsAny())).Returns("1"); option1.SetupGet(_ => _.Selected).Returns(false); option1.SetupGet(_ => _.Enabled).Returns(true); @@ -275,7 +275,7 @@ public void CanDeselectSingleOptionSelectedByText() options.Add(option1.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(true); option1.Setup(_ => _.Click()); webElement.Setup(_ => _.FindElements(It.IsAny())).Returns(new ReadOnlyCollection(options)).Verifiable(); @@ -294,7 +294,7 @@ public void CanDeselectSingleOptionSelectedByValue() options.Add(option1.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(true); option1.Setup(_ => _.Click()); webElement.Setup(_ => _.FindElements(It.IsAny())).Returns(new ReadOnlyCollection(options)).Verifiable(); @@ -313,7 +313,7 @@ public void CanDeselectSingleOptionSelectedByIndex() options.Add(option1.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.Setup(_ => _.GetAttribute(It.IsAny())).Returns("2"); option1.SetupGet(_ => _.Selected).Returns(true); option1.Setup(_ => _.Click()); @@ -336,7 +336,7 @@ public void CanDeselectMultipleOptionSelectedByText() options.Add(option2.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(true); option1.Setup(_ => _.Click()); option2.SetupGet(_ => _.Selected).Returns(true); @@ -356,7 +356,7 @@ public void CanDeselectMultipleOptionSelectedByValue() options.Add(option2.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.SetupGet(_ => _.Selected).Returns(true); option1.Setup(_ => _.Click()); option2.SetupGet(_ => _.Selected).Returns(true); @@ -381,7 +381,7 @@ public void CanDeselectMultipleOptionSelectedByIndex() options.Add(option2.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); option1.Setup(_ => _.GetAttribute(It.IsAny())).Returns("1"); option1.SetupGet(_ => _.Selected).Returns(true); option1.Setup(_ => _.Click()); @@ -409,7 +409,7 @@ public void SelectedOptionPropertyShouldThrowExceptionWhenNoOptionSelected() options.Add(notSelected.Object); webElement.SetupGet(_ => _.TagName).Returns("select"); - webElement.Setup(_ => _.GetAttribute(It.Is(x => x == "multiple"))).Returns("true"); + webElement.Setup(_ => _.GetDomAttribute(It.Is(x => x == "multiple"))).Returns("true"); notSelected.SetupGet(_ => _.Selected).Returns(false); webElement.Setup(_ => _.FindElements(It.IsAny())).Returns(new ReadOnlyCollection(options)).Verifiable();