Skip to content

Commit 76f3dc5

Browse files
committed
Remove DriverOptions.ToString() implementation
1 parent e9c2117 commit 76f3dc5

File tree

6 files changed

+0
-98
lines changed

6 files changed

+0
-98
lines changed

dotnet/src/webdriver/DriverOptions.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using System;
2323
using System.Collections.Generic;
2424
using System.Globalization;
25-
using System.Text;
2625

2726
namespace OpenQA.Selenium
2827
{
@@ -390,44 +389,6 @@ public void SetLoggingPreference(string logType, LogLevel logLevel)
390389
this.loggingPreferences[logType] = logLevel;
391390
}
392391

393-
/// <summary>
394-
/// Returns a string representation of this <see cref="DriverOptions"/>.
395-
/// </summary>
396-
/// <returns>A string representation of this <see cref="DriverOptions"/>.</returns>
397-
public override string ToString()
398-
{
399-
StringBuilder builder = new StringBuilder();
400-
bool needComma = false;
401-
402-
string browserName = this.BrowserName;
403-
if (!string.IsNullOrEmpty(browserName))
404-
{
405-
builder.Append("Browser: ").Append(browserName);
406-
407-
string browserVersion = this.BrowserVersion;
408-
if (!string.IsNullOrEmpty(browserVersion))
409-
{
410-
builder.Append(' ');
411-
builder.Append(browserVersion);
412-
}
413-
414-
needComma = true;
415-
}
416-
417-
string platformName = this.PlatformName;
418-
if (!string.IsNullOrEmpty(platformName))
419-
{
420-
if (needComma)
421-
{
422-
builder.Append(", ");
423-
}
424-
425-
builder.Append("Platform: ").Append(platformName);
426-
}
427-
428-
return builder.ToString();
429-
}
430-
431392
/// <summary>
432393
/// Returns the current options as a <see cref="Dictionary{TKey, TValue}"/>.
433394
/// </summary>

dotnet/test/chrome/ChromeSpecificTests.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,5 @@ public void RunAfterAnyTests()
3131
EnvironmentManager.Instance.CloseCurrentDriver();
3232
EnvironmentManager.Instance.WebServer.Stop();
3333
}
34-
35-
[Test]
36-
public void ChromeOptionsToString()
37-
{
38-
var options = new ChromeOptions();
39-
options.BrowserVersion = "128";
40-
options.PlatformName = "windows";
41-
Assert.That(options.ToString(), Is.EqualTo("Browser: chrome 128, Platform: windows"));
42-
}
4334
}
4435
}

dotnet/test/edge/EdgeSpecificTests.cs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,11 @@
1818
// </copyright>
1919

2020
using NUnit.Framework;
21-
using OpenQA.Selenium.Environment;
2221

2322
namespace OpenQA.Selenium.Edge
2423
{
2524
[TestFixture]
2625
public class EdgeSpecificTests : DriverTestFixture
2726
{
28-
[OneTimeTearDown]
29-
public void RunAfterAnyTests()
30-
{
31-
EnvironmentManager.Instance.CloseCurrentDriver();
32-
EnvironmentManager.Instance.WebServer.Stop();
33-
}
34-
35-
[Test]
36-
public void EdgeOptionsToString()
37-
{
38-
var options = new EdgeOptions();
39-
options.BrowserVersion = "128";
40-
options.PlatformName = "windows";
41-
Assert.That(options.ToString(), Is.EqualTo("Browser: MicrosoftEdge 128, Platform: windows"));
42-
}
4327
}
4428
}

dotnet/test/firefox/FirefoxDriverTest.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,6 @@ public void ShouldInstallAndUninstallUnSignedDirAddon()
366366
Assert.That(driver.FindElements(By.Id("webextensions-selenium-example")).Count, Is.Zero);
367367
}
368368

369-
[Test]
370-
public void FirefoxOptionsToString()
371-
{
372-
var options = new FirefoxOptions();
373-
options.BrowserVersion = "128";
374-
options.PlatformName = "windows";
375-
Assert.That(options.ToString(), Is.EqualTo("Browser: firefox 128, Platform: windows"));
376-
}
377-
378369
private string GetPath(string name)
379370
{
380371
string sCurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

dotnet/test/ie/IeSpecificTests.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,6 @@ public void TestInvisibleZOrder()
360360
element.Click();
361361
}
362362

363-
//[Test]
364-
public void InternetExplorerOptionsToString()
365-
{
366-
var options = new InternetExplorerOptions();
367-
368-
Assert.That(options.ToString(), Is.EqualTo("Browser: internet explorer, Platform: windows"));
369-
}
370-
371363
private long GetScrollTop()
372364
{
373365
return (long)((IJavaScriptExecutor)driver).ExecuteScript("return document.body.scrollTop;");

dotnet/test/safari/SafariSpecificTests.cs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,11 @@
1818
// </copyright>
1919

2020
using NUnit.Framework;
21-
using OpenQA.Selenium.Environment;
2221

2322
namespace OpenQA.Selenium.Safari
2423
{
2524
[TestFixture]
2625
public class SafariSpecificTests : DriverTestFixture
2726
{
28-
[OneTimeTearDown]
29-
public void RunAfterAnyTests()
30-
{
31-
EnvironmentManager.Instance.CloseCurrentDriver();
32-
EnvironmentManager.Instance.WebServer.Stop();
33-
}
34-
35-
[Test]
36-
public void SafariOptionsToString()
37-
{
38-
var options = new SafariOptions();
39-
40-
options.BrowserVersion = "5.1.7";
41-
options.PlatformName = "macos";
42-
Assert.That(options.ToString(), Is.EqualTo("Browser: safari 5.1.7, Platform: macos"));
43-
}
4427
}
4528
}

0 commit comments

Comments
 (0)