From c6707a9417b3090c4c1f07fbc786ffa3b859170f Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Fri, 25 Oct 2024 20:06:57 +1100 Subject: [PATCH] docs --- docs/combinations.md | 82 ++++++++++++------- src/Directory.Build.props | 2 +- ...nsTests.WithCaptureExceptions.verified.txt | 2 +- .../VerifyCombinationsTests.cs | 3 +- .../VerifyCombinationsTests.cs | 3 +- src/Verify.Fixie/Verifier_Combination.cs | 9 -- ...mbinationsTests.WithException.verified.txt | 12 +-- .../VerifyCombinationsTests.cs | 3 +- src/Verify.MSTest/Verifier_Combination.cs | 9 -- src/Verify.MSTest/VerifyBase_Combination.cs | 9 -- ...mbinationsTests.WithException.verified.txt | 12 +-- .../VerifyCombinationsTests.cs | 3 +- src/Verify.NUnit/Verifier_Combination.cs | 9 -- src/Verify.NUnit/VerifyBase_Combination.cs | 9 -- ...mbinationsTests.WithException.verified.txt | 12 +-- .../VerifyCombinationsTests.cs | 3 +- src/Verify.TUnit/Verifier_Combination.cs | 9 -- ...le.BuildAddressExceptionsTest.verified.txt | 38 ++++----- src/Verify.Tests/VerifyCombinationsSample.cs | 1 - ...mbinationsTests.WithException.verified.txt | 12 +-- .../VerifyCombinationsTests.cs | 3 +- src/Verify.Xunit/Verifier_Combination.cs | 9 -- src/Verify.Xunit/VerifyBase_Combination.cs | 9 -- ...mbinationsTests.WithException.verified.txt | 12 +-- .../VerifyCombinationsTests.cs | 3 +- src/Verify.XunitV3/Verifier_Combination.cs | 9 -- src/Verify.XunitV3/VerifyBase_Combination.cs | 9 -- .../CombinationResultsConverter.cs | 26 +++++- .../InnerVerifier_Combinations.cs | 2 +- .../Combinations/VerifyCombinationSettings.cs | 4 +- 30 files changed, 135 insertions(+), 193 deletions(-) diff --git a/docs/combinations.md b/docs/combinations.md index 77c7fb9ef..81ae02df6 100644 --- a/docs/combinations.md +++ b/docs/combinations.md @@ -25,7 +25,7 @@ public static string BuildAddress(int streetNumber, string street, string city) return $"{streetNumber} {street}, {city}"; } ``` -snippet source | anchor +snippet source | anchor @@ -47,7 +47,7 @@ public Task BuildAddressTest() cities); } ``` -snippet source | anchor +snippet source | anchor @@ -104,7 +104,7 @@ public Task BuildAddressExceptionsTest() captureExceptions: true); } ``` -snippet source | anchor +snippet source | anchor @@ -114,31 +114,27 @@ public Task BuildAddressExceptionsTest() ```txt { - -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city'), - -1, Valid St, Valid City: -ArgumentOutOfRangeException: streetNumber ('-1') must be greater than or equal to '1'. (Parameter 'streetNumber') -Actual value was -1., - 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city'), - 0, Valid St, Valid City: -ArgumentOutOfRangeException: streetNumber ('0') must be greater than or equal to '1'. (Parameter 'streetNumber') -Actual value was 0., - 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city'), + -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city')., + -1, Valid St, Valid City: ArgumentOutOfRangeException: streetNumber ('-1') must be greater than or equal to '1'. (Parameter 'streetNumber'). Actual value was -1., + 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city')., + 0, Valid St, Valid City: ArgumentOutOfRangeException: streetNumber ('0') must be greater than or equal to '1'. (Parameter 'streetNumber'). Actual value was 0., + 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city')., 10, Valid St, Valid City: 10 Valid St, Valid City } ``` -snippet source | anchor +snippet source | anchor @@ -153,7 +149,7 @@ Exception capture can be enable globally: public static void Initialize() => VerifyCombinationSettings.CaptureExceptions(); ``` -snippet source | anchor +snippet source | anchor If exception capture has been enabled globally, it can be disable at the method test level using `captureExceptions: false`. @@ -175,7 +171,7 @@ public Task BuildAddressExceptionsDisabledTest() captureExceptions: false); } ``` -snippet source | anchor +snippet source | anchor @@ -276,11 +272,35 @@ public class CombinationResultsConverter : return; } - writer.WriteValue($"{exception.GetType().Name}: {exception.Message}"); + var message = exception.Message; + if (exception is ArgumentException) + { + message = FlattenMessage(message); + } + + writer.WriteValue($"{exception.GetType().Name}: {message}"); + } + + static string FlattenMessage(string message) + { + var builder = new StringBuilder(); + + foreach (var line in message.AsSpan().EnumerateLines()) + { + var trimmed = line.TrimEnd(); + builder.Append(trimmed); + if (!trimmed.EndsWith('.')) + { + builder.Append(". "); + } + } + + builder.TrimEnd(); + return builder.ToString(); } } ``` -snippet source | anchor +snippet source | anchor @@ -306,7 +326,7 @@ class CustomCombinationConverter : string.Join(", ", keys.Select(_ => _.Value)); } ``` -snippet source | anchor +snippet source | anchor Full control of serialization can be achieved by inheriting from `WriteOnlyJsonConverter`. @@ -325,7 +345,7 @@ static CustomCombinationConverter customConverter = new(); public static void Init() => VerifierSettings.AddExtraSettings(_ => _.Converters.Insert(0, customConverter)); ``` -snippet source | anchor +snippet source | anchor diff --git a/src/Directory.Build.props b/src/Directory.Build.props index f270054c8..58b29d9cc 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget - 27.1.0-beta.2 + 27.1.0 enable preview 1.0.0 diff --git a/src/StaticSettingsTests/VerifyCombinationsTests.WithCaptureExceptions.verified.txt b/src/StaticSettingsTests/VerifyCombinationsTests.WithCaptureExceptions.verified.txt index ff17ad070..5c549ba15 100644 --- a/src/StaticSettingsTests/VerifyCombinationsTests.WithCaptureExceptions.verified.txt +++ b/src/StaticSettingsTests/VerifyCombinationsTests.WithCaptureExceptions.verified.txt @@ -1,5 +1,5 @@ { A: a, - b: ArgumentException: B is not allowed, + b: ArgumentException: B is not allowed., C: c } \ No newline at end of file diff --git a/src/StaticSettingsTests/VerifyCombinationsTests.cs b/src/StaticSettingsTests/VerifyCombinationsTests.cs index 68f45bf22..3bdb2014c 100644 --- a/src/StaticSettingsTests/VerifyCombinationsTests.cs +++ b/src/StaticSettingsTests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -public class VerifyCombinationsTests +public class VerifyCombinationsTests { #region GlobalCaptureExceptions diff --git a/src/Verify.Fixie.Tests/VerifyCombinationsTests.cs b/src/Verify.Fixie.Tests/VerifyCombinationsTests.cs index f3eae9cea..7410681ee 100644 --- a/src/Verify.Fixie.Tests/VerifyCombinationsTests.cs +++ b/src/Verify.Fixie.Tests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -public class VerifyCombinationsTests +public class VerifyCombinationsTests { public Task One() { diff --git a/src/Verify.Fixie/Verifier_Combination.cs b/src/Verify.Fixie/Verifier_Combination.cs index 43d47ad8e..f34152bc1 100644 --- a/src/Verify.Fixie/Verifier_Combination.cs +++ b/src/Verify.Fixie/Verifier_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyFixie; public static partial class Verifier { [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -17,7 +16,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -31,7 +29,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +43,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -62,7 +58,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -79,7 +74,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +91,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -116,7 +109,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -136,7 +128,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g, h)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.MSTest.Tests/VerifyCombinationsTests.WithException.verified.txt b/src/Verify.MSTest.Tests/VerifyCombinationsTests.WithException.verified.txt index aea5ba4eb..b4464bffa 100644 --- a/src/Verify.MSTest.Tests/VerifyCombinationsTests.WithException.verified.txt +++ b/src/Verify.MSTest.Tests/VerifyCombinationsTests.WithException.verified.txt @@ -5,12 +5,12 @@ A, 2, False: a2False, A, 3, True : a3True, A, 3, False: a3False, - b, 1, True : ArgumentException: B is not allowed, - b, 1, False: ArgumentException: B is not allowed, - b, 2, True : ArgumentException: B is not allowed, - b, 2, False: ArgumentException: B is not allowed, - b, 3, True : ArgumentException: B is not allowed, - b, 3, False: ArgumentException: B is not allowed, + b, 1, True : ArgumentException: B is not allowed., + b, 1, False: ArgumentException: B is not allowed., + b, 2, True : ArgumentException: B is not allowed., + b, 2, False: ArgumentException: B is not allowed., + b, 3, True : ArgumentException: B is not allowed., + b, 3, False: ArgumentException: B is not allowed., C, 1, True : c1True, C, 1, False: c1False, C, 2, True : c2True, diff --git a/src/Verify.MSTest.Tests/VerifyCombinationsTests.cs b/src/Verify.MSTest.Tests/VerifyCombinationsTests.cs index a78cadf46..c4ac07022 100644 --- a/src/Verify.MSTest.Tests/VerifyCombinationsTests.cs +++ b/src/Verify.MSTest.Tests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -[TestClass] +[TestClass] public partial class VerifyCombinationsTests { [TestMethod] diff --git a/src/Verify.MSTest/Verifier_Combination.cs b/src/Verify.MSTest/Verifier_Combination.cs index b7447cc5c..317972e84 100644 --- a/src/Verify.MSTest/Verifier_Combination.cs +++ b/src/Verify.MSTest/Verifier_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyMSTest; public static partial class Verifier { [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -17,7 +16,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -31,7 +29,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +43,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -62,7 +58,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -79,7 +74,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +91,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -116,7 +109,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -136,7 +128,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g, h)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.MSTest/VerifyBase_Combination.cs b/src/Verify.MSTest/VerifyBase_Combination.cs index 03aba286a..e97e96ea9 100644 --- a/src/Verify.MSTest/VerifyBase_Combination.cs +++ b/src/Verify.MSTest/VerifyBase_Combination.cs @@ -6,7 +6,6 @@ public partial class VerifyBase #pragma warning disable CA1822 // Mark members as static [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -16,7 +15,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -27,7 +25,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -39,7 +36,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -52,7 +48,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -66,7 +61,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -81,7 +75,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +90,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -114,7 +106,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, h, captureExceptions, settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.NUnit.Tests/VerifyCombinationsTests.WithException.verified.txt b/src/Verify.NUnit.Tests/VerifyCombinationsTests.WithException.verified.txt index aea5ba4eb..b4464bffa 100644 --- a/src/Verify.NUnit.Tests/VerifyCombinationsTests.WithException.verified.txt +++ b/src/Verify.NUnit.Tests/VerifyCombinationsTests.WithException.verified.txt @@ -5,12 +5,12 @@ A, 2, False: a2False, A, 3, True : a3True, A, 3, False: a3False, - b, 1, True : ArgumentException: B is not allowed, - b, 1, False: ArgumentException: B is not allowed, - b, 2, True : ArgumentException: B is not allowed, - b, 2, False: ArgumentException: B is not allowed, - b, 3, True : ArgumentException: B is not allowed, - b, 3, False: ArgumentException: B is not allowed, + b, 1, True : ArgumentException: B is not allowed., + b, 1, False: ArgumentException: B is not allowed., + b, 2, True : ArgumentException: B is not allowed., + b, 2, False: ArgumentException: B is not allowed., + b, 3, True : ArgumentException: B is not allowed., + b, 3, False: ArgumentException: B is not allowed., C, 1, True : c1True, C, 1, False: c1False, C, 2, True : c2True, diff --git a/src/Verify.NUnit.Tests/VerifyCombinationsTests.cs b/src/Verify.NUnit.Tests/VerifyCombinationsTests.cs index 6957ea7a8..f8c6f4264 100644 --- a/src/Verify.NUnit.Tests/VerifyCombinationsTests.cs +++ b/src/Verify.NUnit.Tests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -[TestFixture] +[TestFixture] public class VerifyCombinationsTests { [Test] diff --git a/src/Verify.NUnit/Verifier_Combination.cs b/src/Verify.NUnit/Verifier_Combination.cs index cde1a3d09..809ba0380 100644 --- a/src/Verify.NUnit/Verifier_Combination.cs +++ b/src/Verify.NUnit/Verifier_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyNUnit; public static partial class Verifier { [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -17,7 +16,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -31,7 +29,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +43,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -62,7 +58,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -79,7 +74,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +91,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -116,7 +109,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -136,7 +128,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g, h)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.NUnit/VerifyBase_Combination.cs b/src/Verify.NUnit/VerifyBase_Combination.cs index 2a5be6ae6..492df9bf1 100644 --- a/src/Verify.NUnit/VerifyBase_Combination.cs +++ b/src/Verify.NUnit/VerifyBase_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyNUnit; public partial class VerifyBase { [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -13,7 +12,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -23,7 +21,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -34,7 +31,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +42,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -59,7 +54,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -73,7 +67,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -88,7 +81,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -104,7 +96,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, h, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.TUnit.Tests/VerifyCombinationsTests.WithException.verified.txt b/src/Verify.TUnit.Tests/VerifyCombinationsTests.WithException.verified.txt index aea5ba4eb..b4464bffa 100644 --- a/src/Verify.TUnit.Tests/VerifyCombinationsTests.WithException.verified.txt +++ b/src/Verify.TUnit.Tests/VerifyCombinationsTests.WithException.verified.txt @@ -5,12 +5,12 @@ A, 2, False: a2False, A, 3, True : a3True, A, 3, False: a3False, - b, 1, True : ArgumentException: B is not allowed, - b, 1, False: ArgumentException: B is not allowed, - b, 2, True : ArgumentException: B is not allowed, - b, 2, False: ArgumentException: B is not allowed, - b, 3, True : ArgumentException: B is not allowed, - b, 3, False: ArgumentException: B is not allowed, + b, 1, True : ArgumentException: B is not allowed., + b, 1, False: ArgumentException: B is not allowed., + b, 2, True : ArgumentException: B is not allowed., + b, 2, False: ArgumentException: B is not allowed., + b, 3, True : ArgumentException: B is not allowed., + b, 3, False: ArgumentException: B is not allowed., C, 1, True : c1True, C, 1, False: c1False, C, 2, True : c2True, diff --git a/src/Verify.TUnit.Tests/VerifyCombinationsTests.cs b/src/Verify.TUnit.Tests/VerifyCombinationsTests.cs index d8a5c3280..98c0195b3 100644 --- a/src/Verify.TUnit.Tests/VerifyCombinationsTests.cs +++ b/src/Verify.TUnit.Tests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -public class VerifyCombinationsTests +public class VerifyCombinationsTests { [Test] public Task One() diff --git a/src/Verify.TUnit/Verifier_Combination.cs b/src/Verify.TUnit/Verifier_Combination.cs index 5a935daf6..926763af6 100644 --- a/src/Verify.TUnit/Verifier_Combination.cs +++ b/src/Verify.TUnit/Verifier_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyTUnit; public static partial class Verifier { [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -17,7 +16,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -31,7 +29,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +43,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -62,7 +58,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -79,7 +74,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +91,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -116,7 +109,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -136,7 +128,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g, h)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.Tests/VerifyCombinationsSample.BuildAddressExceptionsTest.verified.txt b/src/Verify.Tests/VerifyCombinationsSample.BuildAddressExceptionsTest.verified.txt index 6488b0017..79470abf3 100644 --- a/src/Verify.Tests/VerifyCombinationsSample.BuildAddressExceptionsTest.verified.txt +++ b/src/Verify.Tests/VerifyCombinationsSample.BuildAddressExceptionsTest.verified.txt @@ -1,24 +1,20 @@ { - -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - -1, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city'), - -1, Valid St, Valid City: -ArgumentOutOfRangeException: streetNumber ('-1') must be greater than or equal to '1'. (Parameter 'streetNumber') -Actual value was -1., - 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 0, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city'), - 0, Valid St, Valid City: -ArgumentOutOfRangeException: streetNumber ('0') must be greater than or equal to '1'. (Parameter 'streetNumber') -Actual value was 0., - 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street'), - 10, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city'), + -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + -1, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city')., + -1, Valid St, Valid City: ArgumentOutOfRangeException: streetNumber ('-1') must be greater than or equal to '1'. (Parameter 'streetNumber'). Actual value was -1., + 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 0, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city')., + 0, Valid St, Valid City: ArgumentOutOfRangeException: streetNumber ('0') must be greater than or equal to '1'. (Parameter 'streetNumber'). Actual value was 0., + 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, , null : ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, , Valid City: ArgumentException: The value cannot be an empty string or composed entirely of whitespace. (Parameter 'street')., + 10, Valid St, null : ArgumentNullException: Value cannot be null. (Parameter 'city')., 10, Valid St, Valid City: 10 Valid St, Valid City } \ No newline at end of file diff --git a/src/Verify.Tests/VerifyCombinationsSample.cs b/src/Verify.Tests/VerifyCombinationsSample.cs index 28b718e95..7e6adc1c0 100644 --- a/src/Verify.Tests/VerifyCombinationsSample.cs +++ b/src/Verify.Tests/VerifyCombinationsSample.cs @@ -1,5 +1,4 @@ // ReSharper disable MemberCanBePrivate.Global -#pragma warning disable VerifyCombinations #if NET8_0_OR_GREATER public class VerifyCombinationsSample { diff --git a/src/Verify.Xunit.Tests/VerifyCombinationsTests.WithException.verified.txt b/src/Verify.Xunit.Tests/VerifyCombinationsTests.WithException.verified.txt index aea5ba4eb..b4464bffa 100644 --- a/src/Verify.Xunit.Tests/VerifyCombinationsTests.WithException.verified.txt +++ b/src/Verify.Xunit.Tests/VerifyCombinationsTests.WithException.verified.txt @@ -5,12 +5,12 @@ A, 2, False: a2False, A, 3, True : a3True, A, 3, False: a3False, - b, 1, True : ArgumentException: B is not allowed, - b, 1, False: ArgumentException: B is not allowed, - b, 2, True : ArgumentException: B is not allowed, - b, 2, False: ArgumentException: B is not allowed, - b, 3, True : ArgumentException: B is not allowed, - b, 3, False: ArgumentException: B is not allowed, + b, 1, True : ArgumentException: B is not allowed., + b, 1, False: ArgumentException: B is not allowed., + b, 2, True : ArgumentException: B is not allowed., + b, 2, False: ArgumentException: B is not allowed., + b, 3, True : ArgumentException: B is not allowed., + b, 3, False: ArgumentException: B is not allowed., C, 1, True : c1True, C, 1, False: c1False, C, 2, True : c2True, diff --git a/src/Verify.Xunit.Tests/VerifyCombinationsTests.cs b/src/Verify.Xunit.Tests/VerifyCombinationsTests.cs index c138c5a56..8a4c1348f 100644 --- a/src/Verify.Xunit.Tests/VerifyCombinationsTests.cs +++ b/src/Verify.Xunit.Tests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -public class VerifyCombinationsTests +public class VerifyCombinationsTests { [Fact] public Task One() diff --git a/src/Verify.Xunit/Verifier_Combination.cs b/src/Verify.Xunit/Verifier_Combination.cs index 3104718f9..86675670f 100644 --- a/src/Verify.Xunit/Verifier_Combination.cs +++ b/src/Verify.Xunit/Verifier_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyXunit; public static partial class Verifier { [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -17,7 +16,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -31,7 +29,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +43,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -62,7 +58,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -79,7 +74,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +91,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -116,7 +109,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -136,7 +128,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g, h)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.Xunit/VerifyBase_Combination.cs b/src/Verify.Xunit/VerifyBase_Combination.cs index 04f5d6cf7..68608a42f 100644 --- a/src/Verify.Xunit/VerifyBase_Combination.cs +++ b/src/Verify.Xunit/VerifyBase_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyXunit; public partial class VerifyBase { [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -13,7 +12,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -23,7 +21,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -34,7 +31,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +42,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -59,7 +54,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -73,7 +67,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -88,7 +81,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -104,7 +96,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, h, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.XunitV3.Tests/VerifyCombinationsTests.WithException.verified.txt b/src/Verify.XunitV3.Tests/VerifyCombinationsTests.WithException.verified.txt index aea5ba4eb..b4464bffa 100644 --- a/src/Verify.XunitV3.Tests/VerifyCombinationsTests.WithException.verified.txt +++ b/src/Verify.XunitV3.Tests/VerifyCombinationsTests.WithException.verified.txt @@ -5,12 +5,12 @@ A, 2, False: a2False, A, 3, True : a3True, A, 3, False: a3False, - b, 1, True : ArgumentException: B is not allowed, - b, 1, False: ArgumentException: B is not allowed, - b, 2, True : ArgumentException: B is not allowed, - b, 2, False: ArgumentException: B is not allowed, - b, 3, True : ArgumentException: B is not allowed, - b, 3, False: ArgumentException: B is not allowed, + b, 1, True : ArgumentException: B is not allowed., + b, 1, False: ArgumentException: B is not allowed., + b, 2, True : ArgumentException: B is not allowed., + b, 2, False: ArgumentException: B is not allowed., + b, 3, True : ArgumentException: B is not allowed., + b, 3, False: ArgumentException: B is not allowed., C, 1, True : c1True, C, 1, False: c1False, C, 2, True : c2True, diff --git a/src/Verify.XunitV3.Tests/VerifyCombinationsTests.cs b/src/Verify.XunitV3.Tests/VerifyCombinationsTests.cs index 6ec2f2d7a..9d068c7f4 100644 --- a/src/Verify.XunitV3.Tests/VerifyCombinationsTests.cs +++ b/src/Verify.XunitV3.Tests/VerifyCombinationsTests.cs @@ -1,5 +1,4 @@ -#pragma warning disable VerifyCombinations -public class VerifyCombinationsTests +public class VerifyCombinationsTests { [Fact] public Task One() diff --git a/src/Verify.XunitV3/Verifier_Combination.cs b/src/Verify.XunitV3/Verifier_Combination.cs index 3104718f9..86675670f 100644 --- a/src/Verify.XunitV3/Verifier_Combination.cs +++ b/src/Verify.XunitV3/Verifier_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyXunit; public static partial class Verifier { [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -17,7 +16,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -31,7 +29,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +43,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -62,7 +58,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -79,7 +74,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -97,7 +91,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -116,7 +109,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -136,7 +128,6 @@ public static SettingsTask VerifyCombinations( _ => _.VerifyCombinations(method, captureExceptions, a, b, c, d, e, f, g, h)); [Pure] - [Experimental("VerifyCombinations")] public static SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify.XunitV3/VerifyBase_Combination.cs b/src/Verify.XunitV3/VerifyBase_Combination.cs index 04f5d6cf7..68608a42f 100644 --- a/src/Verify.XunitV3/VerifyBase_Combination.cs +++ b/src/Verify.XunitV3/VerifyBase_Combination.cs @@ -4,7 +4,6 @@ namespace VerifyXunit; public partial class VerifyBase { [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -13,7 +12,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -23,7 +21,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -34,7 +31,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -46,7 +42,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -59,7 +54,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -73,7 +67,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -88,7 +81,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, IEnumerable a, @@ -104,7 +96,6 @@ public SettingsTask VerifyCombinations( Verifier.VerifyCombinations(method, a, b, c, d, e, f, g, h, captureExceptions, settings ?? this.settings, sourceFile); [Pure] - [Experimental("VerifyCombinations")] public SettingsTask VerifyCombinations( Func method, List> lists, diff --git a/src/Verify/Combinations/CombinationResultsConverter.cs b/src/Verify/Combinations/CombinationResultsConverter.cs index 18e74d491..a8aa0cefe 100644 --- a/src/Verify/Combinations/CombinationResultsConverter.cs +++ b/src/Verify/Combinations/CombinationResultsConverter.cs @@ -88,6 +88,30 @@ protected virtual void WriteValue(VerifyJsonWriter writer, CombinationResult res return; } - writer.WriteValue($"{exception.GetType().Name}: {exception.Message}"); + var message = exception.Message; + if (exception is ArgumentException) + { + message = FlattenMessage(message); + } + + writer.WriteValue($"{exception.GetType().Name}: {message}"); + } + + static string FlattenMessage(string message) + { + var builder = new StringBuilder(); + + foreach (var line in message.AsSpan().EnumerateLines()) + { + var trimmed = line.TrimEnd(); + builder.Append(trimmed); + if (!trimmed.EndsWith('.')) + { + builder.Append(". "); + } + } + + builder.TrimEnd(); + return builder.ToString(); } } \ No newline at end of file diff --git a/src/Verify/Combinations/InnerVerifier_Combinations.cs b/src/Verify/Combinations/InnerVerifier_Combinations.cs index 1e506e6b0..ea82f5b7d 100644 --- a/src/Verify/Combinations/InnerVerifier_Combinations.cs +++ b/src/Verify/Combinations/InnerVerifier_Combinations.cs @@ -240,7 +240,7 @@ static CombinationResults GetCombinations( var listCopy = lists.Select(_ => _.ToList()).ToList(); keyTypes = BuildKeyTypes(lists, keyTypes); - var resolvedCaptureException = captureExceptions ?? VerifyCombinationSettings.captureExceptions; + var resolvedCaptureException = captureExceptions ?? VerifyCombinationSettings.CaptureExceptionsEnabled; var combinationGenerator = new CombinationGenerator( listCopy, diff --git a/src/Verify/Combinations/VerifyCombinationSettings.cs b/src/Verify/Combinations/VerifyCombinationSettings.cs index 7c89f39aa..55db41286 100644 --- a/src/Verify/Combinations/VerifyCombinationSettings.cs +++ b/src/Verify/Combinations/VerifyCombinationSettings.cs @@ -2,8 +2,8 @@ public static class VerifyCombinationSettings { - internal static bool captureExceptions; + public static bool CaptureExceptionsEnabled { get; private set; } public static void CaptureExceptions() => - captureExceptions = true; + CaptureExceptionsEnabled = true; } \ No newline at end of file