Skip to content

Commit 1c23e13

Browse files
[dotnet] Remove JSON serialization from .ToString() methods (#14736)
1 parent 3906742 commit 1c23e13

File tree

3 files changed

+0
-30
lines changed

3 files changed

+0
-30
lines changed

dotnet/src/webdriver/DriverOptions.cs

Lines changed: 0 additions & 10 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.Json;
2625

2726
namespace OpenQA.Selenium
2827
{
@@ -390,15 +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-
return JsonSerializer.Serialize(this.ToDictionary(), new JsonSerializerOptions { WriteIndented = true });
400-
}
401-
402392
/// <summary>
403393
/// Returns the current options as a <see cref="Dictionary{TKey, TValue}"/>.
404394
/// </summary>

dotnet/src/webdriver/Internal/ReturnedCapabilities.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using System.Collections.Generic;
2222
using System.Collections.ObjectModel;
2323
using System.Globalization;
24-
using System.Text.Json;
2524

2625
namespace OpenQA.Selenium.Internal
2726
{
@@ -147,14 +146,5 @@ public Dictionary<string, object> ToDictionary()
147146
// we might want to copy/clone it instead.
148147
return this.capabilities;
149148
}
150-
151-
/// <summary>
152-
/// Return a string of capabilities being used
153-
/// </summary>
154-
/// <returns>String of capabilities being used</returns>
155-
public override string ToString()
156-
{
157-
return JsonSerializer.Serialize(this.capabilities, new JsonSerializerOptions { WriteIndented = true });
158-
}
159149
}
160150
}

dotnet/src/webdriver/Remote/RemoteSessionSettings.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
using System;
2222
using System.Collections.Generic;
2323
using System.Globalization;
24-
using System.Text.Json;
2524

2625
namespace OpenQA.Selenium
2726
{
@@ -252,15 +251,6 @@ public Dictionary<string, object> ToDictionary()
252251
return capabilitiesDictionary;
253252
}
254253

255-
/// <summary>
256-
/// Return a string representation of the remote session settings to be sent.
257-
/// </summary>
258-
/// <returns>String representation of the remote session settings to be sent.</returns>
259-
public override string ToString()
260-
{
261-
return JsonSerializer.Serialize(this.ToDictionary(), new JsonSerializerOptions { WriteIndented = true });
262-
}
263-
264254
internal DriverOptions GetFirstMatchDriverOptions(int firstMatchIndex)
265255
{
266256
if (firstMatchIndex < 0 || firstMatchIndex >= this.firstMatchOptions.Count)

0 commit comments

Comments
 (0)