diff --git a/src/Cake.Common.Tests/Cake.Common.Tests.csproj b/src/Cake.Common.Tests/Cake.Common.Tests.csproj index 0c7b725246..0d1b477ca8 100644 --- a/src/Cake.Common.Tests/Cake.Common.Tests.csproj +++ b/src/Cake.Common.Tests/Cake.Common.Tests.csproj @@ -17,8 +17,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Cake.Common.Tests/Unit/ReleaseNotesParserTests.cs b/src/Cake.Common.Tests/Unit/ReleaseNotesParserTests.cs index 364f12adf5..418c142e97 100644 --- a/src/Cake.Common.Tests/Unit/ReleaseNotesParserTests.cs +++ b/src/Cake.Common.Tests/Unit/ReleaseNotesParserTests.cs @@ -79,7 +79,7 @@ public void Should_Parse_Release_Note_Text() var result = parser.Parse(content); // Then - Assert.Equal(1, result[0].Notes.Count); + Assert.Single(result[0].Notes); Assert.Equal("Line 1", result[0].Notes[0]); } @@ -94,7 +94,7 @@ public void Should_Remove_Bullets_From_Release_Note_Text() var result = parser.Parse(content); // Then - Assert.Equal(1, result[0].Notes.Count); + Assert.Single(result[0].Notes); Assert.Equal("Line 1", result[0].Notes[0]); } @@ -143,7 +143,7 @@ public void Should_Remove_Empty_Lines_From_Release_Note_Text() var result = parser.Parse(content); // Then - Assert.Equal(1, result[0].Notes.Count); + Assert.Single(result[0].Notes); Assert.Equal("Line 1", result[0].Notes[0]); } @@ -239,7 +239,7 @@ public void Should_Parse_Release_Note_Text() var result = parser.Parse(content); // Then - Assert.Equal(1, result[0].Notes.Count); + Assert.Single(result[0].Notes); Assert.Equal("Line 1", result[0].Notes[0]); } diff --git a/src/Cake.Common.Tests/Unit/Tools/MSBuild/MSBuildSettingsExtensionsTests.cs b/src/Cake.Common.Tests/Unit/Tools/MSBuild/MSBuildSettingsExtensionsTests.cs index 4fe7721a1e..2d9b2c1549 100644 --- a/src/Cake.Common.Tests/Unit/Tools/MSBuild/MSBuildSettingsExtensionsTests.cs +++ b/src/Cake.Common.Tests/Unit/Tools/MSBuild/MSBuildSettingsExtensionsTests.cs @@ -945,7 +945,7 @@ public void Should_Set_WarningsAsError() // Then Assert.True(settings.WarningsAsError); - Assert.Equal(0, settings.WarningsAsErrorCodes.Count); + Assert.Empty(settings.WarningsAsErrorCodes); } [Fact] @@ -959,7 +959,7 @@ public void Should_Add_Codes() // Then Assert.True(settings.WarningsAsError); - Assert.Equal(1, settings.WarningsAsErrorCodes.Count); + Assert.Single(settings.WarningsAsErrorCodes); Assert.Equal("12345", settings.WarningsAsErrorCodes.First()); } @@ -989,7 +989,7 @@ public void Should_Add_Codes() settings.WithWarningsAsMessage("12345"); // Then - Assert.Equal(1, settings.WarningsAsMessageCodes.Count); + Assert.Single(settings.WarningsAsMessageCodes); Assert.Equal("12345", settings.WarningsAsMessageCodes.First()); } diff --git a/src/Cake.Core.Tests/Cake.Core.Tests.csproj b/src/Cake.Core.Tests/Cake.Core.Tests.csproj index fba755aebb..5ab212ea53 100644 --- a/src/Cake.Core.Tests/Cake.Core.Tests.csproj +++ b/src/Cake.Core.Tests/Cake.Core.Tests.csproj @@ -15,8 +15,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Cake.Core.Tests/Unit/Graph/CakeGraphTests.cs b/src/Cake.Core.Tests/Unit/Graph/CakeGraphTests.cs index b7f3f21c7f..9af0ffb9c3 100644 --- a/src/Cake.Core.Tests/Unit/Graph/CakeGraphTests.cs +++ b/src/Cake.Core.Tests/Unit/Graph/CakeGraphTests.cs @@ -36,7 +36,7 @@ public void Should_Add_Node_To_Graph() graph.Add("start"); // Then - Assert.Equal(1, graph.Nodes.Count); + Assert.Single(graph.Nodes); } [Fact] @@ -110,7 +110,7 @@ public void Should_Not_Create_Edge_Between_Connected_Nodes_If_An_Edge_Already_Ex graph.Connect("start", "end"); // Then - Assert.Equal(1, graph.Edges.Count); + Assert.Single(graph.Edges); } [Fact] @@ -124,7 +124,7 @@ public void Should_Not_Create_Edge_Between_Connected_Nodes_If_An_Edge_Already_Ex graph.Connect("START", "END"); // Then - Assert.Equal(1, graph.Edges.Count); + Assert.Single(graph.Edges); } [Fact] diff --git a/src/Cake.Core.Tests/Unit/Scripting/Analysis/ScriptAnalyzerTests.cs b/src/Cake.Core.Tests/Unit/Scripting/Analysis/ScriptAnalyzerTests.cs index aadc195d51..8bd68365f4 100644 --- a/src/Cake.Core.Tests/Unit/Scripting/Analysis/ScriptAnalyzerTests.cs +++ b/src/Cake.Core.Tests/Unit/Scripting/Analysis/ScriptAnalyzerTests.cs @@ -82,7 +82,7 @@ public void Should_Return_Error_If_Script_Was_Not_Found() // Then Assert.False(result.Succeeded); - Assert.Equal(1, result.Errors.Count); + Assert.Single(result.Errors); Assert.Equal("Could not find script '/Working/notfound.cake'.", result.Errors[0].Message); } @@ -115,7 +115,7 @@ public void Should_Return_Single_Assembly_Reference_Found_In_Source(string sourc var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.References.Count); + Assert.Single(result.Script.References); Assert.Equal("hello.dll", result.Script.References.ElementAt(0)); } @@ -132,7 +132,7 @@ public void Should_Return_Single_Assembly_Reference_With_Space_In_File_Name_Foun var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.References.Count); + Assert.Single(result.Script.References); Assert.Equal("hello world.dll", result.Script.References.ElementAt(0)); } @@ -165,7 +165,7 @@ public void Should_Process_Using_Directives() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Namespaces.Count); + Assert.Single(result.Script.Namespaces); Assert.Equal("Cake.Core", result.Script.Namespaces.ElementAt(0)); } @@ -180,7 +180,7 @@ public void Should_Process_Using_Alias_Directives() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.UsingAliases.Count); + Assert.Single(result.Script.UsingAliases); Assert.Equal("using Core = Cake.Core;", result.Script.UsingAliases.ElementAt(0)); } @@ -195,8 +195,8 @@ public void Should_Keep_Using_Block() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(0, result.Script.UsingAliases.Count); - Assert.Equal(0, result.Script.Namespaces.Count); + Assert.Empty(result.Script.UsingAliases); + Assert.Empty(result.Script.Namespaces); Assert.Equal(4, result.Lines.Count); Assert.Equal(result.Lines[0], "#line 1 \"/Working/script.cake\""); Assert.Equal(result.Lines[1], "using(new Temp())"); @@ -232,7 +232,7 @@ public void Should_Process_Addin_Directive_Without_Source() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Addins.Count); + Assert.Single(result.Script.Addins); Assert.Equal("nuget:?package=Hello.World", result.Script.Addins.ElementAt(0).OriginalString); } @@ -247,7 +247,7 @@ public void Should_Process_Addin_Directive_Using_Uri() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Addins.Count); + Assert.Single(result.Script.Addins); Assert.Equal("npm:?package=node", result.Script.Addins.ElementAt(0).OriginalString); } @@ -262,7 +262,7 @@ public void Should_Process_Addin_Directive_With_Source() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Addins.Count); + Assert.Single(result.Script.Addins); Assert.Equal("nuget:http://source/?package=Hello.World", result.Script.Addins.ElementAt(0).OriginalString); } @@ -277,7 +277,7 @@ public void Should_Process_Tool_Directive_Without_Source() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Tools.Count); + Assert.Single(result.Script.Tools); Assert.Equal("nuget:?package=Hello.World", result.Script.Tools.ElementAt(0).OriginalString); } @@ -292,7 +292,7 @@ public void Should_Process_Tool_Directive_With_Source() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Tools.Count); + Assert.Single(result.Script.Tools); Assert.Equal("nuget:http://source/?package=Hello.World", result.Script.Tools.ElementAt(0).OriginalString); } @@ -307,7 +307,7 @@ public void Should_Process_Tool_Directive_Using_Uri() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Tools.Count); + Assert.Single(result.Script.Tools); Assert.Equal("npm:?package=node", result.Script.Tools.ElementAt(0).OriginalString); } @@ -343,7 +343,7 @@ public void Should_Log_Error_Location() Assert.Equal("#line 1 \"/Working/script.cake\"", result.Lines[0]); Assert.Equal("// #load \"local:?pat\"", result.Lines[1]); Assert.False(result.Succeeded); - Assert.Equal(1, result.Errors.Count); + Assert.Single(result.Errors); Assert.Equal("/Working/script.cake", result.Errors[0].File.FullPath); Assert.Equal(1, result.Errors[0].Line); Assert.Equal("Query string for #load is missing parameter 'path'.", result.Errors[0].Message); @@ -364,7 +364,7 @@ public void Should_Log_Error_Location_In_Loaded_Script() // Then Assert.Equal(6, result.Lines.Count); Assert.False(result.Succeeded); - Assert.Equal(1, result.Errors.Count); + Assert.Single(result.Errors); Assert.Equal("/Working/script2.cake", result.Errors[0].File.FullPath); Assert.Equal(2, result.Errors[0].Line); Assert.Equal("Query string for #load contains more than one parameter 'path'.", result.Errors[0].Message); @@ -381,7 +381,7 @@ public void Should_Process_Using_Static_Directives() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.UsingStaticDirectives.Count); + Assert.Single(result.Script.UsingStaticDirectives); Assert.Equal("using static System.Math;", result.Script.UsingStaticDirectives.ElementAt(0)); } @@ -396,7 +396,7 @@ public void Should_Process_Define_Directives() var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Defines.Count); + Assert.Single(result.Script.Defines); Assert.Equal("#define FOO", result.Script.Defines.ElementAt(0)); } } diff --git a/src/Cake.Core.Tests/Unit/Scripting/Processors/LoadDirectiveProcessorTests.cs b/src/Cake.Core.Tests/Unit/Scripting/Processors/LoadDirectiveProcessorTests.cs index f400bcd95a..6ec85b8662 100644 --- a/src/Cake.Core.Tests/Unit/Scripting/Processors/LoadDirectiveProcessorTests.cs +++ b/src/Cake.Core.Tests/Unit/Scripting/Processors/LoadDirectiveProcessorTests.cs @@ -25,7 +25,7 @@ public void Should_Process_Single_Script_Reference_Found_In_Source(string source var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("/Working/utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -44,7 +44,7 @@ public void Should_Process_Single_Script_Reference_With_Spaces_In_File_Name_Foun var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("/Working/test/my utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -63,7 +63,7 @@ public void Should_Process_Single_Script_Reference_With_Any_Extension_Found_In_S var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal($"/Working/{filename}", result.Script.Includes[0].Path.FullPath); } @@ -103,7 +103,7 @@ public void Should_Process_Environment_Variable_Found_In_Source(string source) var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("/Working/test/utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -123,7 +123,7 @@ public void Should_Process_Multiple_Environment_Variable_Found_In_Source(string var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("/Working/test/scripts/utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -151,7 +151,7 @@ public void Should_Ignore_Globber_Matches_With_Invalid_Extensions(string source) var result = fixture.Analyze("/Working/bootstrap.cake"); // Then - Assert.Equal(0, result.Script.Includes.Count); + Assert.Empty(result.Script.Includes); } [Theory] @@ -232,7 +232,7 @@ public void Should_Process_AbsolutePath_Script_Reference_Found_In_Source(string var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("/utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -251,7 +251,7 @@ public void Should_Process_RelativePath_Script_Reference_Found_In_Source(string var result = fixture.Analyze("/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("/Working/test/utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -270,7 +270,7 @@ public void Should_Process_WindowsAbsolutePath_Script_Reference_Found_In_Source( var result = fixture.Analyze("C:/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("C:/utils.cake", result.Script.Includes[0].Path.FullPath); } @@ -289,7 +289,7 @@ public void Should_Process_WindowsRelativePath_Script_Reference_Found_In_Source( var result = fixture.Analyze("C:/Working/script.cake"); // Then - Assert.Equal(1, result.Script.Includes.Count); + Assert.Single(result.Script.Includes); Assert.Equal("C:/Working/test/utils.cake", result.Script.Includes[0].Path.FullPath); } } diff --git a/src/Cake.Core.Tests/Unit/Scripting/ScriptAliasTests.cs b/src/Cake.Core.Tests/Unit/Scripting/ScriptAliasTests.cs index 65c1315c0f..c531b3b238 100644 --- a/src/Cake.Core.Tests/Unit/Scripting/ScriptAliasTests.cs +++ b/src/Cake.Core.Tests/Unit/Scripting/ScriptAliasTests.cs @@ -34,7 +34,7 @@ public void Should_Not_Throw_If_Method_Is_Null() var result = new ScriptAlias(method, ScriptAliasType.Method, null); // Then - Assert.Equal(0, result.Namespaces.Count); + Assert.Empty(result.Namespaces); } } } diff --git a/src/Cake.Core.Tests/Unit/Scripting/ScriptTests.cs b/src/Cake.Core.Tests/Unit/Scripting/ScriptTests.cs index 5aa6588386..53ed41b9b0 100644 --- a/src/Cake.Core.Tests/Unit/Scripting/ScriptTests.cs +++ b/src/Cake.Core.Tests/Unit/Scripting/ScriptTests.cs @@ -4,6 +4,7 @@ using Cake.Core.Scripting; using Xunit; +using static System.Array; namespace Cake.Core.Tests.Unit.Scripting { @@ -15,60 +16,60 @@ public sealed class TheConstructor public void Should_Not_Throw_If_Namespaces_Are_Null() { // Given, When - var script = new Script(null, new string[] { }, new ScriptAlias[] { }, new string[] { }, new string[] { }, new string[] { }); + var script = new Script(null, Empty(), Empty(), Empty(), Empty(), Empty()); // Then - Assert.Equal(0, script.Namespaces.Count); + Assert.Empty(script.Namespaces); } [Fact] public void Should_Not_Throw_If_Lines_Are_Null() { // Given, When - var script = new Script(new string[] { }, null, new ScriptAlias[] { }, new string[] { }, new string[] { }, new string[] { }); + var script = new Script(Empty(), null, new ScriptAlias[] { }, Empty(), Empty(), Empty()); // Then - Assert.Equal(0, script.Lines.Count); + Assert.Empty(script.Lines); } [Fact] public void Should_Not_Throw_If_Aliases_Are_Null() { // Given, When - var script = new Script(new string[] { }, new string[] { }, null, new string[] { }, new string[] { }, new string[] { }); + var script = new Script(Empty(), Empty(), null, Empty(), Empty(), Empty()); // Then - Assert.Equal(0, script.Aliases.Count); + Assert.Empty(script.Aliases); } [Fact] public void Should_Not_Throw_If_Using_Alias_Directives_Are_Null() { // Given, When - var script = new Script(new string[] { }, new string[] { }, new ScriptAlias[] { }, null, new string[] { }, new string[] { }); + var script = new Script(Empty(), Empty(), Empty(), null, Empty(), Empty()); // Then - Assert.Equal(0, script.UsingAliasDirectives.Count); + Assert.Empty(script.UsingAliasDirectives); } [Fact] public void Should_Not_Throw_If_Using_Static_Directives_Are_Null() { // Given, When - var script = new Script(new string[] { }, new string[] { }, new ScriptAlias[] { }, new string[] { }, null, new string[] { }); + var script = new Script(Empty(), Empty(), Empty(), Empty(), null, Empty()); // Then - Assert.Equal(0, script.UsingStaticDirectives.Count); + Assert.Empty(script.UsingStaticDirectives); } [Fact] public void Should_Not_Throw_If_Defines_Are_Null() { // Given, When - var script = new Script(new string[] { }, new string[] { }, new ScriptAlias[] { }, new string[] { }, new string[] { }, null); + var script = new Script(Empty(), Empty(), Empty(), Empty(), Empty(), null); // Then - Assert.Equal(0, script.Defines.Count); + Assert.Empty(script.Defines); } } } diff --git a/src/Cake.DotNetTool.Module.Tests/Cake.DotNetTool.Module.Tests.csproj b/src/Cake.DotNetTool.Module.Tests/Cake.DotNetTool.Module.Tests.csproj index 7485b25b0a..4456c42c5c 100644 --- a/src/Cake.DotNetTool.Module.Tests/Cake.DotNetTool.Module.Tests.csproj +++ b/src/Cake.DotNetTool.Module.Tests/Cake.DotNetTool.Module.Tests.csproj @@ -17,8 +17,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj b/src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj index 04a303b9b2..ba7e795c47 100644 --- a/src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj +++ b/src/Cake.Frosting.Tests/Cake.Frosting.Tests.csproj @@ -10,8 +10,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Cake.NuGet.Tests/Cake.NuGet.Tests.csproj b/src/Cake.NuGet.Tests/Cake.NuGet.Tests.csproj index 31c9625dc3..78ea742d85 100644 --- a/src/Cake.NuGet.Tests/Cake.NuGet.Tests.csproj +++ b/src/Cake.NuGet.Tests/Cake.NuGet.Tests.csproj @@ -16,8 +16,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Cake.NuGet.Tests/Unit/NuGetContentResolverTests.cs b/src/Cake.NuGet.Tests/Unit/NuGetContentResolverTests.cs index 295591712b..f44098a66a 100644 --- a/src/Cake.NuGet.Tests/Unit/NuGetContentResolverTests.cs +++ b/src/Cake.NuGet.Tests/Unit/NuGetContentResolverTests.cs @@ -29,7 +29,7 @@ public void Should_Return_Exe_Files_By_Default() var files = fixture.GetFiles(); // Then - Assert.Equal(1, files.Count); + Assert.Single(files); Assert.Equal("/Working/tools/Foo/Foo.exe", files.First().Path.FullPath); } @@ -46,7 +46,7 @@ public void Should_Return_Dll_Files_By_Default() var files = fixture.GetFiles(); // Then - Assert.Equal(1, files.Count); + Assert.Single(files); Assert.Equal("/Working/tools/Foo/Foo.dll", files.First().Path.FullPath); } @@ -87,7 +87,7 @@ public void Should_Excluded_Files_If_Specified(string package) var files = fixture.GetFiles(); // Then - Assert.Equal(0, files.Count); + Assert.Empty(files); } [Fact] @@ -148,7 +148,7 @@ public void Should_Return_Exact_Framework_If_Possible(string framework, Runtime var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); Assert.Equal($"/Working/lib/{expected}/file.dll", result.ElementAt(0).Path.FullPath); } @@ -169,7 +169,7 @@ public void Should_Return_Nearest_Compatible_Framework_If_An_Exact_Match_Is_Not_ var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); Assert.Equal($"/Working/lib/{expected}/file.dll", result.ElementAt(0).Path.FullPath); } @@ -188,7 +188,7 @@ public void Should_Return_Empty_Result_If_Any_Match_Is_Not_Possible(string frame var result = fixture.GetFiles(); // Then - Assert.Equal(0, result.Count); + Assert.Empty(result); } [Fact] @@ -206,7 +206,7 @@ public void Should_Return_Compatible_Netstandard_If_An_Exact_Match_Is_Not_Possib var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); Assert.Equal($"/Working/lib/netstandard1.6/file.dll", result.ElementAt(0).Path.FullPath); } @@ -223,7 +223,7 @@ public void Should_Return_Only_CLR_Assemblies() var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); Assert.Equal("/Working/lib/netstandard1.6/file.dll", result.ElementAt(0).Path.FullPath); } @@ -266,7 +266,7 @@ public void Should_Return_Exact_Framework_Even_Though_Files_Located_In_Root(stri var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); Assert.Equal($"/Working/lib/{expected}/file.dll", result.ElementAt(0).Path.FullPath); } @@ -285,7 +285,7 @@ public void Should_Return_From_Root_If_No_Compatible_Framework_Found(string fram var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); Assert.Equal($"/Working/file.dll", result.ElementAt(0).Path.FullPath); } @@ -330,7 +330,7 @@ public void Should_Not_Return_Ref_Assemblies(string framework, Runtime runtime) var result = fixture.GetFiles(); // Then - Assert.Equal(0, result.Count); + Assert.Empty(result); } public void Should_Return_Runtimes_Assemblies_If_CoreCLR() @@ -349,7 +349,7 @@ public void Should_Return_Runtimes_Assemblies_If_CoreCLR() var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); } public void Should_Return_Native_Runtimes_Assemblies_If_CoreCLR() @@ -367,7 +367,7 @@ public void Should_Return_Native_Runtimes_Assemblies_If_CoreCLR() var result = fixture.GetFiles(); // Then - Assert.Equal(1, result.Count); + Assert.Single(result); } } } diff --git a/src/Cake.NuGet.Tests/Unit/NuGetLoadDirectiveProviderTests.cs b/src/Cake.NuGet.Tests/Unit/NuGetLoadDirectiveProviderTests.cs index 9c300af187..53527f7a81 100644 --- a/src/Cake.NuGet.Tests/Unit/NuGetLoadDirectiveProviderTests.cs +++ b/src/Cake.NuGet.Tests/Unit/NuGetLoadDirectiveProviderTests.cs @@ -148,7 +148,7 @@ public void Should_Write_To_Log_If_No_Scripts_Were_Found() fixture.Load(); // Then - Assert.Equal(1, fixture.Log.Entries.Count); + Assert.Single(fixture.Log.Entries); Assert.Equal("No scripts found in NuGet package Cake.Recipe.", fixture.Log.Entries[0].Message); Assert.Equal(Verbosity.Minimal, fixture.Log.Entries[0].Verbosity); Assert.Equal(LogLevel.Warning, fixture.Log.Entries[0].Level); diff --git a/src/Cake.Testing.Xunit/Cake.Testing.Xunit.csproj b/src/Cake.Testing.Xunit/Cake.Testing.Xunit.csproj index 4ca967f60b..af7d9f598f 100644 --- a/src/Cake.Testing.Xunit/Cake.Testing.Xunit.csproj +++ b/src/Cake.Testing.Xunit/Cake.Testing.Xunit.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/Cake.Tests/Cake.Tests.csproj b/src/Cake.Tests/Cake.Tests.csproj index e96871918b..d530c01aba 100644 --- a/src/Cake.Tests/Cake.Tests.csproj +++ b/src/Cake.Tests/Cake.Tests.csproj @@ -11,8 +11,8 @@ - - + + all runtime; build; native; contentfiles; analyzers