From e02b708b15104b173de01981d8ce53b064d97389 Mon Sep 17 00:00:00 2001 From: Terje Sandstrom Date: Thu, 13 Nov 2025 12:58:09 +0100 Subject: [PATCH] fix snippets --- .../Snippets.NUnit/ClassicAssertExamples.cs | 18 +++++--- .../Snippets.NUnit/ConstraintExamples.cs | 2 + .../Snippets.NUnit/Snippets.NUnit.csproj | 40 +++++++++--------- .../Snippets.NUnitLite.csproj | 41 ++++++++++--------- 4 files changed, 56 insertions(+), 45 deletions(-) diff --git a/docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs b/docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs index 1befb910d..eb639f4f9 100644 --- a/docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs +++ b/docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs @@ -1,13 +1,13 @@ using NUnit.Framework; using NUnit.Framework.Legacy; -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; #pragma warning disable CA1822 #pragma warning disable NUnit2045 #pragma warning disable NUnit2005 +#pragma warning disable NUnit2006 +#pragma warning disable NUnit2015 +#pragma warning disable NUnit2031 +#pragma warning disable NUnit2049 namespace Snippets.NUnit; @@ -65,6 +65,9 @@ public void False_Examples() } #endregion +#pragma warning disable CS8600 +#pragma warning disable CS8625 + #region NullExamples [Test] public void Null_Examples() @@ -78,7 +81,9 @@ public void Null_Examples() ClassicAssert.IsNotNull(obj); } #endregion - +#pragma warning restore CS8600 +#pragma warning restore CS8625 + #region SameExamples [Test] public void Same_Examples() @@ -289,6 +294,8 @@ public void CollectionAssert_Ordered_Examples() } #endregion + +#pragma warning disable CS8625 #region CollectionAssertItemTypeExamples [Test] public void CollectionAssert_ItemType_Examples() @@ -301,4 +308,5 @@ public void CollectionAssert_ItemType_Examples() CollectionAssert.AllItemsAreUnique(stringList); } #endregion +#pragma warning restore CS8625 } \ No newline at end of file diff --git a/docs/snippets/Snippets.NUnit/ConstraintExamples.cs b/docs/snippets/Snippets.NUnit/ConstraintExamples.cs index 0f42789f2..2a1127942 100644 --- a/docs/snippets/Snippets.NUnit/ConstraintExamples.cs +++ b/docs/snippets/Snippets.NUnit/ConstraintExamples.cs @@ -3,6 +3,8 @@ #pragma warning disable CA1822 #pragma warning disable NUnit2045 #pragma warning disable CA2211 +#pragma warning disable NUnit2007 +#pragma warning disable NUnit2009 namespace Snippets.NUnit; diff --git a/docs/snippets/Snippets.NUnit/Snippets.NUnit.csproj b/docs/snippets/Snippets.NUnit/Snippets.NUnit.csproj index ac9cd7e15..b2cad4ce0 100644 --- a/docs/snippets/Snippets.NUnit/Snippets.NUnit.csproj +++ b/docs/snippets/Snippets.NUnit/Snippets.NUnit.csproj @@ -1,25 +1,25 @@  - - net8.0 - enable - enable + + net8.0 + enable + enable + NUnit2007;NUnit2009;CS7022 + false + - false - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/docs/snippets/Snippets.NUnitLite/Snippets.NUnitLite.csproj b/docs/snippets/Snippets.NUnitLite/Snippets.NUnitLite.csproj index 05ab09169..f2a9a0944 100644 --- a/docs/snippets/Snippets.NUnitLite/Snippets.NUnitLite.csproj +++ b/docs/snippets/Snippets.NUnitLite/Snippets.NUnitLite.csproj @@ -1,25 +1,26 @@ - - net8.0 - Snippets.NUnitLite - enable - enable - Exe - false - true - + + net8.0 + Snippets.NUnitLite + enable + enable + Exe + false + NUnit2007;NUnit2009;CS7022 + true + - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + +