Skip to content

Commit dff173e

Browse files
committed
ran dotnet format for error severity
1 parent ccf57f5 commit dff173e

File tree

66 files changed

+387
-355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+387
-355
lines changed

src/SystemTextJson.JsonDiffPatch.MSTest/JsonAssert.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text.Json.Nodes;
2+
23
using Microsoft.VisualStudio.TestTools.UnitTesting;
34

45
namespace System.Text.Json.JsonDiffPatch.MsTest
@@ -8,8 +9,8 @@ namespace System.Text.Json.JsonDiffPatch.MsTest
89
/// </summary>
910
public static class JsonAssert
1011
{
11-
private static readonly JsonSerializerOptions SerializerOptions = new() {WriteIndented = true};
12-
12+
private static readonly JsonSerializerOptions SerializerOptions = new() { WriteIndented = true };
13+
1314
/// <summary>
1415
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
1516
/// the ordering of members in the objects is not significant.
@@ -179,7 +180,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
179180
/// <param name="output">Whether to print diff result.</param>
180181
public static void JsonAreEqual(this Assert assert, string? expected, string? actual, bool output)
181182
=> AreEqual(expected, actual, output);
182-
183+
183184
/// <summary>
184185
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
185186
/// the ordering of members in the objects is not significant.
@@ -191,7 +192,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
191192
public static void JsonAreEqual(this Assert assert, string? expected, string? actual,
192193
JsonDiffOptions diffOptions)
193194
=> AreEqual(expected, actual, diffOptions);
194-
195+
195196
/// <summary>
196197
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
197198
/// the ordering of members in the objects is not significant.
@@ -204,7 +205,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
204205
public static void JsonAreEqual(this Assert assert, string? expected, string? actual,
205206
JsonDiffOptions diffOptions, bool output)
206207
=> AreEqual(expected, actual, diffOptions, output);
207-
208+
208209
/// <summary>
209210
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
210211
/// the ordering of members in the objects is not significant.
@@ -230,7 +231,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
230231
JsonDiffOptions diffOptions,
231232
Func<JsonNode, string> outputFormatter)
232233
=> AreEqual(expected, actual, diffOptions, outputFormatter);
233-
234+
234235
/// <summary>
235236
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
236237
/// the ordering of members in the objects is not significant.
@@ -242,7 +243,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
242243
public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual)
243244
where T : JsonNode
244245
=> AreEqual(expected, actual);
245-
246+
246247
/// <summary>
247248
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
248249
/// the ordering of members in the objects is not significant.
@@ -255,7 +256,7 @@ public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual)
255256
public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual, bool output)
256257
where T : JsonNode
257258
=> AreEqual(expected, actual, output);
258-
259+
259260
/// <summary>
260261
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
261262
/// the ordering of members in the objects is not significant.
@@ -268,7 +269,7 @@ public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual, b
268269
public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual, JsonDiffOptions diffOptions)
269270
where T : JsonNode
270271
=> AreEqual(expected, actual, diffOptions);
271-
272+
272273
/// <summary>
273274
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
274275
/// the ordering of members in the objects is not significant.
@@ -283,7 +284,7 @@ public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual,
283284
JsonDiffOptions diffOptions, bool output)
284285
where T : JsonNode
285286
=> AreEqual(expected, actual, diffOptions, output);
286-
287+
287288
/// <summary>
288289
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
289290
/// the ordering of members in the objects is not significant.

src/SystemTextJson.JsonDiffPatch.NUnit/JsonAssert.cs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text.Json.Nodes;
2+
23
using NUnit.Framework;
34

45
namespace System.Text.Json.JsonDiffPatch.Nunit
@@ -8,7 +9,7 @@ namespace System.Text.Json.JsonDiffPatch.Nunit
89
/// </summary>
910
public static class JsonAssert
1011
{
11-
private static readonly JsonSerializerOptions SerializerOptions = new() {WriteIndented = true};
12+
private static readonly JsonSerializerOptions SerializerOptions = new() { WriteIndented = true };
1213

1314
/// <summary>
1415
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
@@ -179,7 +180,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
179180
/// <param name="output">Whether to print diff result.</param>
180181
public static void JsonAreEqual(this Assert assert, string? expected, string? actual, bool output)
181182
=> AreEqual(expected, actual, output);
182-
183+
183184
/// <summary>
184185
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
185186
/// the ordering of members in the objects is not significant.
@@ -191,7 +192,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
191192
public static void JsonAreEqual(this Assert assert, string? expected, string? actual,
192193
JsonDiffOptions diffOptions)
193194
=> AreEqual(expected, actual, diffOptions);
194-
195+
195196
/// <summary>
196197
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
197198
/// the ordering of members in the objects is not significant.
@@ -204,7 +205,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
204205
public static void JsonAreEqual(this Assert assert, string? expected, string? actual,
205206
JsonDiffOptions diffOptions, bool output)
206207
=> AreEqual(expected, actual, diffOptions, output);
207-
208+
208209
/// <summary>
209210
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
210211
/// the ordering of members in the objects is not significant.
@@ -230,7 +231,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
230231
JsonDiffOptions diffOptions,
231232
Func<JsonNode, string> outputFormatter)
232233
=> AreEqual(expected, actual, diffOptions, outputFormatter);
233-
234+
234235
/// <summary>
235236
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
236237
/// the ordering of members in the objects is not significant.
@@ -242,7 +243,7 @@ public static void JsonAreEqual(this Assert assert, string? expected, string? ac
242243
public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual)
243244
where T : JsonNode
244245
=> AreEqual(expected, actual);
245-
246+
246247
/// <summary>
247248
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
248249
/// the ordering of members in the objects is not significant.
@@ -255,7 +256,7 @@ public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual)
255256
public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual, bool output)
256257
where T : JsonNode
257258
=> AreEqual(expected, actual, output);
258-
259+
259260
/// <summary>
260261
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
261262
/// the ordering of members in the objects is not significant.
@@ -268,7 +269,7 @@ public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual, b
268269
public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual, JsonDiffOptions diffOptions)
269270
where T : JsonNode
270271
=> AreEqual(expected, actual, diffOptions);
271-
272+
272273
/// <summary>
273274
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
274275
/// the ordering of members in the objects is not significant.
@@ -283,7 +284,7 @@ public static void JsonAreEqual<T>(this Assert assert, T? expected, T? actual,
283284
JsonDiffOptions diffOptions, bool output)
284285
where T : JsonNode
285286
=> AreEqual(expected, actual, diffOptions, output);
286-
287+
287288
/// <summary>
288289
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
289290
/// the ordering of members in the objects is not significant.
@@ -378,7 +379,7 @@ public static void AreNotEqual(string? expected, string? actual)
378379
public static void AreNotEqual(string? expected, string? actual, JsonDiffOptions diffOptions)
379380
=> AreNotEqual(expected is null ? null : JsonNode.Parse(expected),
380381
actual is null ? null : JsonNode.Parse(actual), diffOptions);
381-
382+
382383
/// <summary>
383384
/// Tests whether two JSON objects are not equal. Note that when comparing the specified objects,
384385
/// the ordering of members in the objects is not significant.
@@ -389,7 +390,7 @@ public static void AreNotEqual(string? expected, string? actual, JsonDiffOptions
389390
public static void AreNotEqual<T>(T? expected, T? actual)
390391
where T : JsonNode
391392
=> HandleAreNotEqual(expected, actual, null);
392-
393+
393394
/// <summary>
394395
/// Tests whether two JSON objects are not equal. Note that when comparing the specified objects,
395396
/// the ordering of members in the objects is not significant.
@@ -402,7 +403,7 @@ public static void AreNotEqual<T>(T? expected, T? actual, JsonDiffOptions diffOp
402403
where T : JsonNode
403404
=> HandleAreNotEqual(expected, actual,
404405
diffOptions ?? throw new ArgumentNullException(nameof(diffOptions)));
405-
406+
406407
/// <summary>
407408
/// Tests whether two JSON objects are not equal. Note that when comparing the specified objects,
408409
/// the ordering of members in the objects is not significant.
@@ -412,7 +413,7 @@ public static void AreNotEqual<T>(T? expected, T? actual, JsonDiffOptions diffOp
412413
/// <param name="actual">The actual value.</param>
413414
public static void JsonAreNotEqual(this Assert assert, string? expected, string? actual)
414415
=> AreNotEqual(expected, actual);
415-
416+
416417
/// <summary>
417418
/// Tests whether two JSON objects are not equal. Note that when comparing the specified objects,
418419
/// the ordering of members in the objects is not significant.
@@ -424,7 +425,7 @@ public static void JsonAreNotEqual(this Assert assert, string? expected, string?
424425
public static void JsonAreNotEqual(this Assert assert, string? expected, string? actual,
425426
JsonDiffOptions diffOptions)
426427
=> AreNotEqual(expected, actual, diffOptions);
427-
428+
428429
/// <summary>
429430
/// Tests whether two JSON objects are not equal. Note that when comparing the specified objects,
430431
/// the ordering of members in the objects is not significant.
@@ -436,7 +437,7 @@ public static void JsonAreNotEqual(this Assert assert, string? expected, string?
436437
public static void JsonAreNotEqual<T>(this Assert assert, T? expected, T? actual)
437438
where T : JsonNode
438439
=> AreNotEqual(expected, actual);
439-
440+
440441
/// <summary>
441442
/// Tests whether two JSON objects are not equal. Note that when comparing the specified objects,
442443
/// the ordering of members in the objects is not significant.

src/SystemTextJson.JsonDiffPatch.NUnit/JsonDiffConstraint.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Text.Json.Nodes;
2+
23
using NUnit.Framework.Constraints;
34

45
namespace System.Text.Json.JsonDiffPatch.Nunit
@@ -11,7 +12,7 @@ public abstract class JsonDiffConstraint : Constraint
1112
private readonly JsonNode? _expected;
1213
private JsonDiffOptions? _diffOptions;
1314
private Func<JsonNode, string>? _outputFormatter;
14-
15+
1516
protected JsonDiffConstraint(JsonNode? expected)
1617
{
1718
_expected = expected;
@@ -25,7 +26,7 @@ public JsonDiffConstraint WithDiffOptions(JsonDiffOptions diffOptions)
2526
_diffOptions = diffOptions ?? throw new ArgumentNullException(nameof(diffOptions));
2627
return this;
2728
}
28-
29+
2930
public JsonDiffConstraint WithOutputFormatter(Func<JsonNode, string> outputFormatter)
3031
{
3132
_outputFormatter = outputFormatter ?? throw new ArgumentNullException(nameof(outputFormatter));
@@ -34,7 +35,7 @@ public JsonDiffConstraint WithOutputFormatter(Func<JsonNode, string> outputForma
3435

3536
public override ConstraintResult ApplyTo<TActual>(TActual actual)
3637
{
37-
Delta = _expected.Diff((JsonNode?) (object?) actual, _diffOptions);
38+
Delta = _expected.Diff((JsonNode?)(object?)actual, _diffOptions);
3839
return new JsonDiffConstraintResult(this, actual, Test());
3940
}
4041

src/SystemTextJson.JsonDiffPatch.NUnit/JsonIs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static class JsonIs
1212
/// </summary>
1313
/// <param name="expected">The expected value.</param>
1414
public static JsonDiffConstraint EqualTo(JsonNode? expected) => new JsonEqualConstraint(expected);
15-
15+
1616
/// <summary>
1717
/// Returns a constraint that tests whether two JSON are not equal.
1818
/// </summary>

src/SystemTextJson.JsonDiffPatch.Xunit/JsonAssert.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace System.Text.Json.JsonDiffPatch.Xunit
77
/// </summary>
88
public static class JsonAssert
99
{
10-
private static readonly JsonSerializerOptions SerializerOptions = new() {WriteIndented = true};
10+
private static readonly JsonSerializerOptions SerializerOptions = new() { WriteIndented = true };
1111

1212
/// <summary>
1313
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
@@ -192,7 +192,7 @@ public static void ShouldEqual<T>(this T? actual, T? expected, bool output)
192192
public static void ShouldEqual<T>(this T? actual, T? expected, JsonDiffOptions diffOptions)
193193
where T : JsonNode
194194
=> Equal(expected, actual, diffOptions);
195-
195+
196196
/// <summary>
197197
/// Tests whether two JSON objects are equal. Note that when comparing the specified objects,
198198
/// the ordering of members in the objects is not significant.
@@ -256,7 +256,7 @@ private static void HandleEqual(JsonNode? expected, JsonNode? actual,
256256
private static string CreateDefaultOutput(JsonNode? expected, JsonNode? actual, JsonNode diff)
257257
{
258258
var sb = new StringBuilder();
259-
259+
260260
sb.Append("Expected:");
261261
sb.AppendLine();
262262
sb.Append(expected is null

src/SystemTextJson.JsonDiffPatch/Diffs/ArrayItemMatch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
/// </summary>
66
/// <param name="context">The comparison context.</param>
77
public delegate bool ArrayItemMatch(ref ArrayItemMatchContext context);
8-
}
8+
}

src/SystemTextJson.JsonDiffPatch/Diffs/ArrayItemMatchContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ public void DeepEqual()
5656
IsDeepEqual = true;
5757
}
5858
}
59-
}
59+
}

src/SystemTextJson.JsonDiffPatch/Diffs/Formatters/IJsonDiffDeltaFormatter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ public interface IJsonDiffDeltaFormatter<out TResult>
1414
/// <param name="left">The left JSON object.</param>
1515
TResult? Format(ref JsonDiffDelta delta, JsonNode? left);
1616
}
17-
}
18-
17+
}

src/SystemTextJson.JsonDiffPatch/Diffs/Formatters/JsonPatchDeltaFormatter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class JsonPatchDeltaFormatter : DefaultDeltaFormatter<JsonNode>
1111
private const string PropertyNameOperation = "op";
1212
private const string PropertyNamePath = "path";
1313
private const string PropertyNameValue = "value";
14-
14+
1515
private const string OperationNameAdd = "add";
1616
private const string OperationNameRemove = "remove";
1717
private const string OperationNameReplace = "replace";
@@ -36,7 +36,7 @@ public JsonPatchDeltaFormatter()
3636
return base.FormatArrayElement(arrayChange, left, existingValue);
3737
}
3838

39-
protected override JsonNode? FormatObjectProperty(ref JsonDiffDelta delta, JsonNode? left,
39+
protected override JsonNode? FormatObjectProperty(ref JsonDiffDelta delta, JsonNode? left,
4040
string propertyName, JsonNode? existingValue)
4141
{
4242
using var _ = new PropertyPathScope(PathBuilder, propertyName);

src/SystemTextJson.JsonDiffPatch/Diffs/JsonDiffContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ public T Right<T>()
4444
throw new InvalidOperationException($"Type must be '{nameof(JsonNode)}' or derived type.");
4545
}
4646
}
47-
}
47+
}

0 commit comments

Comments
 (0)