Skip to content

Commit

Permalink
[dotnet] Remove JSON serialization from .ToString() methods (Seleni…
Browse files Browse the repository at this point in the history
  • Loading branch information
RenderMichael authored and jkim2492 committed Nov 17, 2024
1 parent 5b87aa7 commit 01e464a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 30 deletions.
10 changes: 0 additions & 10 deletions dotnet/src/webdriver/DriverOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.Json;

namespace OpenQA.Selenium
{
Expand Down Expand Up @@ -390,15 +389,6 @@ public void SetLoggingPreference(string logType, LogLevel logLevel)
this.loggingPreferences[logType] = logLevel;
}

/// <summary>
/// Returns a string representation of this <see cref="DriverOptions"/>.
/// </summary>
/// <returns>A string representation of this <see cref="DriverOptions"/>.</returns>
public override string ToString()
{
return JsonSerializer.Serialize(this.ToDictionary(), new JsonSerializerOptions { WriteIndented = true });
}

/// <summary>
/// Returns the current options as a <see cref="Dictionary{TKey, TValue}"/>.
/// </summary>
Expand Down
10 changes: 0 additions & 10 deletions dotnet/src/webdriver/Internal/ReturnedCapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Text.Json;

namespace OpenQA.Selenium.Internal
{
Expand Down Expand Up @@ -147,14 +146,5 @@ public Dictionary<string, object> ToDictionary()
// we might want to copy/clone it instead.
return this.capabilities;
}

/// <summary>
/// Return a string of capabilities being used
/// </summary>
/// <returns>String of capabilities being used</returns>
public override string ToString()
{
return JsonSerializer.Serialize(this.capabilities, new JsonSerializerOptions { WriteIndented = true });
}
}
}
10 changes: 0 additions & 10 deletions dotnet/src/webdriver/Remote/RemoteSessionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.Json;

namespace OpenQA.Selenium
{
Expand Down Expand Up @@ -252,15 +251,6 @@ public Dictionary<string, object> ToDictionary()
return capabilitiesDictionary;
}

/// <summary>
/// Return a string representation of the remote session settings to be sent.
/// </summary>
/// <returns>String representation of the remote session settings to be sent.</returns>
public override string ToString()
{
return JsonSerializer.Serialize(this.ToDictionary(), new JsonSerializerOptions { WriteIndented = true });
}

internal DriverOptions GetFirstMatchDriverOptions(int firstMatchIndex)
{
if (firstMatchIndex < 0 || firstMatchIndex >= this.firstMatchOptions.Count)
Expand Down

0 comments on commit 01e464a

Please sign in to comment.