From 055d9b2c426a3be75c42e1fe62cc1573b8b47033 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Mon, 2 Sep 2024 12:24:40 +1000 Subject: [PATCH] remove incorrect notnull for objects (#1275) --- src/Directory.Build.props | 2 +- src/Verify.NUnit/VerifyBase_Object.cs | 12 ++++-------- src/Verify.Xunit/VerifyBase_Object.cs | 12 ++++-------- src/Verify.XunitV3/VerifyBase_Object.cs | 12 ++++-------- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 9eb5e3d717..5bb01d7533 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -2,7 +2,7 @@ CS1591;CS0649;xUnit1026;xUnit1013;CS1573;VerifyTestsProjectDir;VerifySetParameters;PolyFillTargetsForNuget - 26.3.0 + 26.3.1 enable preview 1.0.0 diff --git a/src/Verify.NUnit/VerifyBase_Object.cs b/src/Verify.NUnit/VerifyBase_Object.cs index 3c9fa711ef..f08501e150 100644 --- a/src/Verify.NUnit/VerifyBase_Object.cs +++ b/src/Verify.NUnit/VerifyBase_Object.cs @@ -5,29 +5,25 @@ public partial class VerifyBase [Pure] public SettingsTask Verify( Func> target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target(), settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( Task target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( ValueTask target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( IAsyncEnumerable target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] diff --git a/src/Verify.Xunit/VerifyBase_Object.cs b/src/Verify.Xunit/VerifyBase_Object.cs index 68fcd56605..0ca7de4c74 100644 --- a/src/Verify.Xunit/VerifyBase_Object.cs +++ b/src/Verify.Xunit/VerifyBase_Object.cs @@ -5,29 +5,25 @@ public partial class VerifyBase [Pure] public SettingsTask Verify( Func> target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target(), settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( Task target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( ValueTask target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( IAsyncEnumerable target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] diff --git a/src/Verify.XunitV3/VerifyBase_Object.cs b/src/Verify.XunitV3/VerifyBase_Object.cs index 68fcd56605..0ca7de4c74 100644 --- a/src/Verify.XunitV3/VerifyBase_Object.cs +++ b/src/Verify.XunitV3/VerifyBase_Object.cs @@ -5,29 +5,25 @@ public partial class VerifyBase [Pure] public SettingsTask Verify( Func> target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target(), settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( Task target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( ValueTask target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure] public SettingsTask Verify( IAsyncEnumerable target, - VerifySettings? settings = null) - where T : notnull => + VerifySettings? settings = null) => Verifier.Verify(target, settings ?? this.settings, sourceFile); [Pure]