|
|
|
@ -109,7 +109,7 @@ VerifierSettings
|
|
|
|
|
.AddExtraSettings(_ =>
|
|
|
|
|
_.TypeNameHandling = TypeNameHandling.All);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L531-L537' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextrasettingsglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L543-L549' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextrasettingsglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -129,7 +129,7 @@ public Task AddExtraSettings()
|
|
|
|
|
return Verify("Value", settings);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L501-L514' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextrasettings' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L513-L526' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextrasettings' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -145,7 +145,7 @@ public Task AddExtraSettingsFluent() =>
|
|
|
|
|
_ => _.Error = (currentObject, originalObject, location, exception, handled) =>
|
|
|
|
|
Console.WriteLine(location.Member));
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L516-L525' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextrasettingsfluent' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L528-L537' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextrasettingsfluent' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -165,7 +165,7 @@ To disable this behavior globally use:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.DontIgnoreEmptyCollections();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1309-L1313' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontignoreemptycollections' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1321-L1325' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontignoreemptycollections' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -187,7 +187,7 @@ var target = new GuidTarget
|
|
|
|
|
|
|
|
|
|
await Verify(target);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1649-L1662' title='Snippet source file'>snippet source</a> | <a href='#snippet-guid' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1661-L1674' title='Snippet source file'>snippet source</a> | <a href='#snippet-guid' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Results in the following:
|
|
|
|
@ -212,7 +212,7 @@ Strings containing inline Guids can also be scrubbed. To enable this behavior, u
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.ScrubInlineGuids();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1349-L1353' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubinlineguids' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1361-L1365' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubinlineguids' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -227,7 +227,7 @@ var settings = new VerifySettings();
|
|
|
|
|
settings.DontScrubGuids();
|
|
|
|
|
await Verify(target, settings);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L640-L646' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubguids' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L652-L658' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubguids' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or with the fluent api:
|
|
|
|
@ -238,7 +238,7 @@ Or with the fluent api:
|
|
|
|
|
await Verify(target)
|
|
|
|
|
.DontScrubGuids();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L654-L659' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubguidsfluent' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L666-L671' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubguidsfluent' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
To disable this behavior globally use:
|
|
|
|
@ -248,7 +248,7 @@ To disable this behavior globally use:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.DontScrubGuids();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1319-L1323' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubguidsglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1331-L1335' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubguidsglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -312,7 +312,7 @@ var target = new DateTimeTarget
|
|
|
|
|
|
|
|
|
|
await Verify(target);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L981-L1000' title='Snippet source file'>snippet source</a> | <a href='#snippet-date' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L993-L1012' title='Snippet source file'>snippet source</a> | <a href='#snippet-date' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Results in the following:
|
|
|
|
@ -350,7 +350,7 @@ settings.DontScrubDateTimes();
|
|
|
|
|
|
|
|
|
|
return Verify(target, settings);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1373-L1385' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubdatetimes' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1385-L1397' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubdatetimes' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or using the fluent api use:
|
|
|
|
@ -366,7 +366,7 @@ var target = new
|
|
|
|
|
return Verify(target)
|
|
|
|
|
.DontScrubDateTimes();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1391-L1401' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubdatetimesfluent' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1403-L1413' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubdatetimesfluent' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally use:
|
|
|
|
@ -376,7 +376,7 @@ Or globally use:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.DontScrubDateTimes();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1408-L1412' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubdatetimesglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1420-L1424' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontscrubdatetimesglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -399,7 +399,7 @@ public Task WithExtraDatetimeFormat() =>
|
|
|
|
|
date = "2022-11-08"
|
|
|
|
|
});
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L133-L147' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextradatetimeformat' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L145-L159' title='Snippet source file'>snippet source</a> | <a href='#snippet-addextradatetimeformat' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -419,7 +419,7 @@ await Verify(target)
|
|
|
|
|
.AddNamedDateTime(new(2030, 1, 2), "instanceNamedDateTime")
|
|
|
|
|
.AddNamedDateTimeOffset(new DateTime(2030, 1, 2), "instanceNamedTimeOffset");
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1116-L1122' title='Snippet source file'>snippet source</a> | <a href='#snippet-addinstancenameddatesandtimes' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1128-L1134' title='Snippet source file'>snippet source</a> | <a href='#snippet-addinstancenameddatesandtimes' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -437,7 +437,7 @@ public static void AddNamedDatesAndTimes()
|
|
|
|
|
VerifierSettings.AddNamedDateTimeOffset(new(new(2030, 1, 1)), "namedDateTimeOffset");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1075-L1086' title='Snippet source file'>snippet source</a> | <a href='#snippet-addnameddatesandtimes' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1087-L1098' title='Snippet source file'>snippet source</a> | <a href='#snippet-addnameddatesandtimes' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -571,7 +571,7 @@ public Task ScopedSerializerFluent()
|
|
|
|
|
.AddExtraSettings(_ => _.TypeNameHandling = TypeNameHandling.All);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3301-L3328' title='Snippet source file'>snippet source</a> | <a href='#snippet-scopedserializer' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3313-L3340' title='Snippet source file'>snippet source</a> | <a href='#snippet-scopedserializer' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -699,7 +699,7 @@ public Task IgnoreTypeFluent()
|
|
|
|
|
.IgnoreMembersWithType<ToIgnoreStruct>();
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2334-L2439' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoretype' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2346-L2451' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoretype' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -709,7 +709,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.IgnoreMembersWithType<ToIgnore>();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2321-L2325' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoretypeglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2333-L2337' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoretypeglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -846,7 +846,7 @@ public Task ScrubTypeFluent()
|
|
|
|
|
.ScrubMembersWithType<ToIgnoreStruct>();
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2442-L2547' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubtype' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2454-L2559' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubtype' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -856,7 +856,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.ScrubMembersWithType<ToIgnore>();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2327-L2331' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubtypeglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2339-L2343' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubtypeglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -935,7 +935,7 @@ public Task AddIgnoreInstanceFluent()
|
|
|
|
|
.IgnoreInstance<Instance>(_ => _.Property == "Ignore");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2207-L2246' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoreinstance' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2219-L2258' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoreinstance' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -945,7 +945,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.IgnoreInstance<Instance>(_ => _.Property == "Ignore");
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2194-L2198' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoreinstanceglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2206-L2210' title='Snippet source file'>snippet source</a> | <a href='#snippet-addignoreinstanceglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1007,7 +1007,7 @@ public Task AddScrubInstanceFluent()
|
|
|
|
|
.ScrubInstance<Instance>(_ => _.Property == "Ignore");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2248-L2287' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubinstance' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2260-L2299' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubinstance' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -1017,7 +1017,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.ScrubInstance<Instance>(_ => _.Property == "Ignore");
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2200-L2204' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubinstanceglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2212-L2216' title='Snippet source file'>snippet source</a> | <a href='#snippet-addscrubinstanceglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1062,7 +1062,7 @@ public Task WithObsoleteProp()
|
|
|
|
|
return Verify(target);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3266-L3287' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoleteprop' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3278-L3299' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoleteprop' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1110,7 +1110,7 @@ public Task WithObsoletePropIncludedFluent()
|
|
|
|
|
.IncludeObsoletes();
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3237-L3264' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincluded' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3249-L3276' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincluded' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -1120,7 +1120,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.IncludeObsoletes();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3230-L3234' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincludedglobally' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3242-L3246' title='Snippet source file'>snippet source</a> | <a href='#snippet-withobsoletepropincludedglobally' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1181,7 +1181,7 @@ public Task IgnoreMemberByExpressionFluent()
|
|
|
|
|
_ => _.PropertyThatThrows);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2748-L2787' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbyexpression' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2760-L2799' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbyexpression' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally
|
|
|
|
@ -1196,7 +1196,7 @@ VerifierSettings.IgnoreMembers<IgnoreExplicitTarget>(
|
|
|
|
|
_ => _.GetOnlyProperty,
|
|
|
|
|
_ => _.PropertyThatThrows);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2725-L2734' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbyexpressionglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2737-L2746' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbyexpressionglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1256,7 +1256,7 @@ public Task ScrubMemberByExpressionFluent()
|
|
|
|
|
_ => _.PropertyThatThrows);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2789-L2828' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbyexpression' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2801-L2840' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbyexpression' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally
|
|
|
|
@ -1271,7 +1271,7 @@ VerifierSettings.ScrubMembers<IgnoreExplicitTarget>(
|
|
|
|
|
_ => _.GetOnlyProperty,
|
|
|
|
|
_ => _.PropertyThatThrows);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2736-L2745' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbyexpressionglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2748-L2757' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbyexpressionglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1350,7 +1350,7 @@ public Task IgnoreMemberByNameFluent()
|
|
|
|
|
.IgnoreMember<IgnoreExplicitTarget>(_ => _.PropertyThatThrows);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2902-L2955' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbyname' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2914-L2967' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbyname' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -1370,7 +1370,7 @@ VerifierSettings.IgnoreMember<IgnoreExplicitTarget>("Field");
|
|
|
|
|
// For a specific type with expression
|
|
|
|
|
VerifierSettings.IgnoreMember<IgnoreExplicitTarget>(_ => _.PropertyThatThrows);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2869-L2883' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbynameglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2881-L2895' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignorememberbynameglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1445,7 +1445,7 @@ public Task ScrubMemberByNameFluent()
|
|
|
|
|
.ScrubMember<IgnoreExplicitTarget>(_ => _.PropertyThatThrows);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2957-L3010' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbyname' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2969-L3022' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbyname' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -1465,7 +1465,7 @@ VerifierSettings.ScrubMember<IgnoreExplicitTarget>("Field");
|
|
|
|
|
// For a specific type with expression
|
|
|
|
|
VerifierSettings.ScrubMember<IgnoreExplicitTarget>(_ => _.PropertyThatThrows);
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2885-L2899' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbynameglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2897-L2911' title='Snippet source file'>snippet source</a> | <a href='#snippet-scrubmemberbynameglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1516,7 +1516,7 @@ public Task CustomExceptionPropFluent()
|
|
|
|
|
.IgnoreMembersThatThrow<CustomException>();
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3118-L3137' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrow' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3130-L3149' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrow' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -1526,7 +1526,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.IgnoreMembersThatThrow<CustomException>();
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3111-L3115' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L3123-L3127' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1563,7 +1563,7 @@ public Task ExceptionMessagePropFluent()
|
|
|
|
|
.IgnoreMembersThatThrow<Exception>(_ => _.Message == "Ignore");
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1984-L2005' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowexpression' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1996-L2017' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowexpression' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Or globally:
|
|
|
|
@ -1573,7 +1573,7 @@ Or globally:
|
|
|
|
|
```cs
|
|
|
|
|
VerifierSettings.IgnoreMembersThatThrow<Exception>(_ => _.Message == "Ignore");
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1977-L1981' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowexpressionglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L1989-L1993' title='Snippet source file'>snippet source</a> | <a href='#snippet-ignoremembersthatthrowexpressionglobal' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
Result:
|
|
|
|
@ -1697,7 +1697,7 @@ public Task MemberConverterByExpression()
|
|
|
|
|
return Verify(input);
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2830-L2858' title='Snippet source file'>snippet source</a> | <a href='#snippet-memberconverter' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L2842-L2870' title='Snippet source file'>snippet source</a> | <a href='#snippet-memberconverter' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1748,7 +1748,7 @@ public Task DontSortDictionaries()
|
|
|
|
|
.DontSortDictionaries();
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L228-L250' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontsortdictionaries' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<sup><a href='/src/Verify.Tests/Serialization/SerializationTests.cs#L240-L262' title='Snippet source file'>snippet source</a> | <a href='#snippet-dontsortdictionaries' title='Start of snippet'>anchor</a></sup>
|
|
|
|
|
<!-- endSnippet -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|