Skip to content

Commit c5193e7

Browse files
fix snippets (#1092)
Co-authored-by: Sean Killeen <[email protected]>
1 parent b952edd commit c5193e7

File tree

4 files changed

+56
-45
lines changed

4 files changed

+56
-45
lines changed

docs/snippets/Snippets.NUnit/ClassicAssertExamples.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using NUnit.Framework;
22
using NUnit.Framework.Legacy;
3-
using System;
4-
using System.Collections;
5-
using System.Collections.Generic;
6-
using System.IO;
73

84
#pragma warning disable CA1822
95
#pragma warning disable NUnit2045
106
#pragma warning disable NUnit2005
7+
#pragma warning disable NUnit2006
8+
#pragma warning disable NUnit2015
9+
#pragma warning disable NUnit2031
10+
#pragma warning disable NUnit2049
1111

1212
namespace Snippets.NUnit;
1313

@@ -65,6 +65,9 @@ public void False_Examples()
6565
}
6666
#endregion
6767

68+
#pragma warning disable CS8600
69+
#pragma warning disable CS8625
70+
6871
#region NullExamples
6972
[Test]
7073
public void Null_Examples()
@@ -78,7 +81,9 @@ public void Null_Examples()
7881
ClassicAssert.IsNotNull(obj);
7982
}
8083
#endregion
81-
84+
#pragma warning restore CS8600
85+
#pragma warning restore CS8625
86+
8287
#region SameExamples
8388
[Test]
8489
public void Same_Examples()
@@ -289,6 +294,8 @@ public void CollectionAssert_Ordered_Examples()
289294
}
290295
#endregion
291296

297+
298+
#pragma warning disable CS8625
292299
#region CollectionAssertItemTypeExamples
293300
[Test]
294301
public void CollectionAssert_ItemType_Examples()
@@ -301,4 +308,5 @@ public void CollectionAssert_ItemType_Examples()
301308
CollectionAssert.AllItemsAreUnique(stringList);
302309
}
303310
#endregion
311+
#pragma warning restore CS8625
304312
}

docs/snippets/Snippets.NUnit/ConstraintExamples.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#pragma warning disable CA1822
44
#pragma warning disable NUnit2045
55
#pragma warning disable CA2211
6+
#pragma warning disable NUnit2007
7+
#pragma warning disable NUnit2009
68

79
namespace Snippets.NUnit;
810

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<Nullable>enable</Nullable>
3+
<PropertyGroup>
4+
<TargetFrameworks>net8.0</TargetFrameworks>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<NoWarn>NUnit2007;NUnit2009;CS7022</NoWarn>
8+
<IsPackable>false</IsPackable>
9+
</PropertyGroup>
710

8-
<IsPackable>false</IsPackable>
9-
</PropertyGroup>
10-
11-
<ItemGroup>
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
13-
<PackageReference Include="NUnit" Version="4.4.0" />
14-
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
15-
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
16-
<PrivateAssets>all</PrivateAssets>
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18-
</PackageReference>
19-
<PackageReference Include="coverlet.collector" Version="6.0.4">
20-
<PrivateAssets>all</PrivateAssets>
21-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22-
</PackageReference>
23-
</ItemGroup>
11+
<ItemGroup>
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
13+
<PackageReference Include="NUnit" Version="4.4.0" />
14+
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
15+
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
</PackageReference>
19+
<PackageReference Include="coverlet.collector" Version="6.0.4">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
23+
</ItemGroup>
2424

2525
</Project>
Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3-
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<RootNamespace>Snippets.NUnitLite</RootNamespace>
6-
<ImplicitUsings>enable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
8-
<OutputType>Exe</OutputType>
9-
<IsPackable>false</IsPackable>
10-
<IsTestProject>true</IsTestProject>
11-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<RootNamespace>Snippets.NUnitLite</RootNamespace>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<OutputType>Exe</OutputType>
9+
<IsPackable>false</IsPackable>
10+
<NoWarn>NUnit2007;NUnit2009;CS7022</NoWarn>
11+
<IsTestProject>true</IsTestProject>
12+
</PropertyGroup>
1213

13-
<ItemGroup>
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
15-
<PackageReference Include="NUnit" Version="4.4.0" />
16-
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
17-
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
<PrivateAssets>all</PrivateAssets>
20-
</PackageReference>
21-
<PackageReference Include="coverlet.collector" Version="6.0.4" />
22-
<PackageReference Include="NUnitLite" Version="4.4.0" />
23-
</ItemGroup>
14+
<ItemGroup>
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
16+
<PackageReference Include="NUnit" Version="4.4.0" />
17+
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
18+
<PackageReference Include="NUnit.Analyzers" Version="4.11.2">
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
<PrivateAssets>all</PrivateAssets>
21+
</PackageReference>
22+
<PackageReference Include="coverlet.collector" Version="6.0.4" />
23+
<PackageReference Include="NUnitLite" Version="4.4.0" />
24+
</ItemGroup>
2425

2526
</Project>

0 commit comments

Comments
 (0)