diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index c024d5025..cc485d17f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,26 +12,25 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [windows-latest, ubuntu-latest, macos-latest]
+ os: [windows-latest, ubuntu-latest, macos-14] # macos-latest runs on arm64e causing issues with .net 8 (https://github.com/actions/runner-images/issues/9766)
env:
# https://github.com/NuGet/Home/issues/11548
# https://twitter.com/xoofx/status/1488617114940452872?s=20&t=BKSN4j9rP6fOyg8l7aW0eg
NUGET_CERT_REVOCATION_MODE: offline
steps:
- name: Get Source
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
with:
submodules: recursive
- name: Install .NET Core SDK
- uses: actions/setup-dotnet@v1
+ uses: actions/setup-dotnet@v4
with:
dotnet-version: |
- 3.1.x
- 6.0.x
+ 8.0.x
- name: Build and Test
run: dotnet test --logger "trx;LogFileName=test-results.trx"
- name: Upload Test Results
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
if: success() || failure()
with:
name: test-results-${{ matrix.os }}
diff --git a/.gitignore b/.gitignore
index 3e709190b..1d295c8e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,4 +38,4 @@ TestResult.xml
*.pfx
.idea
.ionide
-cache/
\ No newline at end of file
+cache/
diff --git a/src/core/Statiq.App/Statiq.App.csproj b/src/core/Statiq.App/Statiq.App.csproj
index 65d025a2a..a5ea72a86 100644
--- a/src/core/Statiq.App/Statiq.App.csproj
+++ b/src/core/Statiq.App/Statiq.App.csproj
@@ -1,34 +1,39 @@
-
Statiq is a configurable static content generation framework. This library provides everything you need to start using it to make your own static generator.
Statiq Static StaticContent StaticSite
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;VSTHRD103;CA1711
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;VSTHRD103;CA1711
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
+
\ No newline at end of file
diff --git a/src/core/Statiq.Common/Statiq.Common.csproj b/src/core/Statiq.Common/Statiq.Common.csproj
index 3b1aa596c..5bf2a79ef 100644
--- a/src/core/Statiq.Common/Statiq.Common.csproj
+++ b/src/core/Statiq.Common/Statiq.Common.csproj
@@ -2,16 +2,23 @@
Statiq is a configurable static content generation framework. This library provides a common set of abstractions and other classes to make writing extensions easier.
Statiq Static StaticContent StaticSite Blog BlogEngine
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1040;CA1711;CA1725;CA1021;CA1720;CS0672;CA1721;CA1710;SYSLIB0010;VSTHRD110
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1040;CA1711;CA1725;CA1021;CA1720;CS0672;CA1721;CA1710;SYSLIB0010;VSTHRD110
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -21,4 +28,7 @@
<_Parameter1>Statiq.Testing
+
+
+
\ No newline at end of file
diff --git a/src/core/Statiq.Core/Execution/Engine.cs b/src/core/Statiq.Core/Execution/Engine.cs
index e8cf12d21..c8ff25bc4 100644
--- a/src/core/Statiq.Core/Execution/Engine.cs
+++ b/src/core/Statiq.Core/Execution/Engine.cs
@@ -141,7 +141,7 @@ public Engine(
FileCleaner = Services.GetRequiredService();
_diagnosticsTraceListener = new DiagnosticsTraceListener(Logger);
- Trace.Listeners.Add(_diagnosticsTraceListener);
+ System.Diagnostics.Trace.Listeners.Add(_diagnosticsTraceListener);
// Add the service-based pipelines as late as possible so other services have been configured
AddServicePipelines();
@@ -1140,7 +1140,7 @@ public void Dispose()
}
}
- Trace.Listeners.Remove(_diagnosticsTraceListener);
+ System.Diagnostics.Trace.Listeners.Remove(_diagnosticsTraceListener);
FileCleaner.CleanDirectory(FileSystem.GetTempDirectory(), "temp");
_serviceScope.Dispose();
_disposed = true;
diff --git a/src/core/Statiq.Core/Execution/IEngineExtensions.cs b/src/core/Statiq.Core/Execution/IEngineExtensions.cs
index 015a76b06..d6d1d65e4 100644
--- a/src/core/Statiq.Core/Execution/IEngineExtensions.cs
+++ b/src/core/Statiq.Core/Execution/IEngineExtensions.cs
@@ -18,16 +18,16 @@ public static void LogAndCheckVersion(this IEngine engine, Assembly assembly, st
// Get and print the version
string informationalVersion = versionAttribute.InformationalVersion;
engine.Logger.LogInformation($"{name} version {informationalVersion}", true);
- SemVer.Version version = new SemVer.Version(informationalVersion, true);
+ SemanticVersioning.Version version = new SemanticVersioning.Version(informationalVersion, true);
// Get all version ranges
- (string Key, SemVer.Version Version)[] minimumVersions = engine.Settings.Keys
+ (string Key, SemanticVersioning.Version Version)[] minimumVersions = engine.Settings.Keys
.Where(k => k.StartsWith(minimumVersionKey))
.Select(k => (Key: k, Value: engine.Settings.GetString(k)))
.Where(x => !x.Value.IsNullOrWhiteSpace())
- .Select(x => (x.Key, new SemVer.Version(x.Value, true)))
+ .Select(x => (x.Key, new SemanticVersioning.Version(x.Value, true)))
.ToArray();
- foreach ((string Key, SemVer.Version Version) minimumVersion in minimumVersions)
+ foreach ((string Key, SemanticVersioning.Version Version) minimumVersion in minimumVersions)
{
if (version < minimumVersion.Version)
{
diff --git a/src/core/Statiq.Core/Execution/MemoryStreamFactory.cs b/src/core/Statiq.Core/Execution/MemoryStreamFactory.cs
index de1638279..34250b256 100644
--- a/src/core/Statiq.Core/Execution/MemoryStreamFactory.cs
+++ b/src/core/Statiq.Core/Execution/MemoryStreamFactory.cs
@@ -14,13 +14,13 @@ public class MemoryStreamFactory : IMemoryStreamFactory
private const int BlockSize = 16384;
private readonly RecyclableMemoryStreamManager _manager =
- new RecyclableMemoryStreamManager(
- BlockSize,
- RecyclableMemoryStreamManager.DefaultLargeBufferMultiple,
- RecyclableMemoryStreamManager.DefaultMaximumBufferSize)
+ new RecyclableMemoryStreamManager(new RecyclableMemoryStreamManager.Options
{
- MaximumFreeSmallPoolBytes = BlockSize * 32768L * 2, // 1 GB
- };
+ BlockSize = BlockSize,
+ LargeBufferMultiple = RecyclableMemoryStreamManager.DefaultLargeBufferMultiple,
+ MaximumBufferSize = RecyclableMemoryStreamManager.DefaultMaximumBufferSize,
+ MaximumSmallPoolFreeBytes = BlockSize * 32768L * 2, // 1 GB
+ });
public virtual MemoryStream GetStream() => _manager.GetStream();
diff --git a/src/core/Statiq.Core/Modules/Content/InsertLinks.cs b/src/core/Statiq.Core/Modules/Content/InsertLinks.cs
index 7461fd377..6fd3770fe 100644
--- a/src/core/Statiq.Core/Modules/Content/InsertLinks.cs
+++ b/src/core/Statiq.Core/Modules/Content/InsertLinks.cs
@@ -150,7 +150,7 @@ public InsertLinks WithEndWordSeparators(params char[] endWordSeparators)
foreach (IElement element in htmlDocument.QuerySelectorAll(_querySelector).Where(t => !t.Ancestors().Any()))
{
// Enumerate all descendant text nodes not already in a link element
- foreach (IText text in element.Descendents().OfType().Where(t => !t.Ancestors().Any()))
+ foreach (IText text in element.Descendants().Where(t => !t.Ancestors().Any()))
{
if (ReplaceStrings(text, links, out string newText))
{
diff --git a/src/core/Statiq.Core/Statiq.Core.csproj b/src/core/Statiq.Core/Statiq.Core.csproj
index b2de0e472..e5005eb43 100644
--- a/src/core/Statiq.Core/Statiq.Core.csproj
+++ b/src/core/Statiq.Core/Statiq.Core.csproj
@@ -2,19 +2,26 @@
Statiq is a configurable static content generation framework.
Statiq Static StaticContent StaticSite Blog BlogEngine
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;CA1711;CA1505
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725;CA1711;CA1505
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
@@ -24,4 +31,7 @@
<_Parameter1>Statiq.Common.Tests
+
+
+
\ No newline at end of file
diff --git a/src/core/Statiq.Testing.JavaScript/Statiq.Testing.JavaScript.csproj b/src/core/Statiq.Testing.JavaScript/Statiq.Testing.JavaScript.csproj
index f7a724490..81db790ba 100644
--- a/src/core/Statiq.Testing.JavaScript/Statiq.Testing.JavaScript.csproj
+++ b/src/core/Statiq.Testing.JavaScript/Statiq.Testing.JavaScript.csproj
@@ -2,12 +2,16 @@
Statiq is a configurable static content generation framework. This library provides utility classes to make testing JavaScript components easier.
Statiq Static StaticContent StaticSite Blog BlogEngine
+ net8.0
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/src/core/Statiq.Testing/Statiq.Testing.csproj b/src/core/Statiq.Testing/Statiq.Testing.csproj
index 2405d486f..f2ffe925c 100644
--- a/src/core/Statiq.Testing/Statiq.Testing.csproj
+++ b/src/core/Statiq.Testing/Statiq.Testing.csproj
@@ -2,18 +2,28 @@
Statiq is a configurable static content generation framework. This library provides utility classes to make testing easier.
Statiq Static StaticContent StaticSite Blog BlogEngine
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1725;CA1062;CA1710;CA1711;CA1721
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1725;CA1062;CA1710;CA1711;CA1721
-
-
-
-
+
+
build
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.CodeAnalysis/Statiq.CodeAnalysis.csproj b/src/extensions/Statiq.CodeAnalysis/Statiq.CodeAnalysis.csproj
index 578d993fb..f6f2b88f7 100644
--- a/src/extensions/Statiq.CodeAnalysis/Statiq.CodeAnalysis.csproj
+++ b/src/extensions/Statiq.CodeAnalysis/Statiq.CodeAnalysis.csproj
@@ -2,12 +2,22 @@
Statiq is a configurable static content generation framework. This library provides support for performing code analysis.
Statiq Static StaticContent StaticSite Blog BlogEngine CodeAnalysis Roslyn XmlDocComments DocComments
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
-
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Feeds/GenerateFeeds.cs b/src/extensions/Statiq.Feeds/GenerateFeeds.cs
index 112d1e423..4631c1f2c 100644
--- a/src/extensions/Statiq.Feeds/GenerateFeeds.cs
+++ b/src/extensions/Statiq.Feeds/GenerateFeeds.cs
@@ -519,7 +519,7 @@ private static string MakeLinksAbsolute(HtmlParser parser, HtmlMarkupFormatter f
{
IHtmlDocument dom = parser.ParseDocument(string.Empty);
INodeList nodes = parser.ParseFragment(value, dom.Body);
- IEnumerable elements = nodes.SelectMany(x => x.Descendents().Where(y => y.HasAttribute("href") || y.HasAttribute("src")));
+ IEnumerable elements = nodes.SelectMany(x => x.Descendants().Where(y => y.HasAttribute("href") || y.HasAttribute("src")));
bool replaced = false;
foreach (IElement element in elements)
{
diff --git a/src/extensions/Statiq.Feeds/Statiq.Feeds.csproj b/src/extensions/Statiq.Feeds/Statiq.Feeds.csproj
index f45ac2342..4e4724038 100644
--- a/src/extensions/Statiq.Feeds/Statiq.Feeds.csproj
+++ b/src/extensions/Statiq.Feeds/Statiq.Feeds.csproj
@@ -2,8 +2,18 @@
Statiq is a configurable static content generation framework. This library provides support for feeds and syndication including RSS and Atom.
Statiq Static StaticContent StaticSite RSS Atom Syndication
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;SYSLIB0013;CA1720
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;SYSLIB0013;CA1720
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Handlebars/Statiq.Handlebars.csproj b/src/extensions/Statiq.Handlebars/Statiq.Handlebars.csproj
index 9e9fe1c60..dbbc1df82 100644
--- a/src/extensions/Statiq.Handlebars/Statiq.Handlebars.csproj
+++ b/src/extensions/Statiq.Handlebars/Statiq.Handlebars.csproj
@@ -2,11 +2,21 @@
Statiq is a configurable static content generation framework. This library provides support for rendering Handlebars content.
Statiq Static StaticContent StaticSite Blog BlogEngine Handlebars
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
-
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Highlight/Statiq.Highlight.csproj b/src/extensions/Statiq.Highlight/Statiq.Highlight.csproj
index 2becbac1d..41ae009ad 100644
--- a/src/extensions/Statiq.Highlight/Statiq.Highlight.csproj
+++ b/src/extensions/Statiq.Highlight/Statiq.Highlight.csproj
@@ -2,6 +2,13 @@
Statiq is a configurable static content generation framework. This library performs server side highlighting of code blocks.
Statiq Static StaticContent StaticSite Blog BlogEngine Highlight.js
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
@@ -12,4 +19,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Images/MutateImage.cs b/src/extensions/Statiq.Images/MutateImage.cs
index ac882146e..4a8444360 100644
--- a/src/extensions/Statiq.Images/MutateImage.cs
+++ b/src/extensions/Statiq.Images/MutateImage.cs
@@ -328,10 +328,9 @@ protected override IEnumerable ExecuteInput(IDocument input, IExecuti
// Get the image
Image image;
- IImageFormat imageFormat;
using (Stream stream = input.GetContentStream())
{
- image = Image.Load(stream, out imageFormat);
+ image = Image.Load(stream);
}
// Mutate the image with the specified operations, if there are any
@@ -357,7 +356,7 @@ protected override IEnumerable ExecuteInput(IDocument input, IExecuti
// Invoke output actions
IEnumerable outputActions = operations.OutputActions.Count == 0
- ? (IEnumerable)new[] { new OutputAction((i, s) => i.Save(s, imageFormat), null) }
+ ? (IEnumerable)new[] { new OutputAction((i, s) => i.Save(s, image.Metadata.DecodedImageFormat), null) }
: operations.OutputActions;
return outputActions.Select(action =>
{
diff --git a/src/extensions/Statiq.Images/Statiq.Images.csproj b/src/extensions/Statiq.Images/Statiq.Images.csproj
index b588603cc..07e9f1f49 100644
--- a/src/extensions/Statiq.Images/Statiq.Images.csproj
+++ b/src/extensions/Statiq.Images/Statiq.Images.csproj
@@ -2,11 +2,21 @@
Statiq is a configurable static content generation framework. This library provides support for manipulating images.
Statiq Static StaticContent StaticSite Blog BlogEngine Images ImageProcessor
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
-
+
-
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Less/Statiq.Less.csproj b/src/extensions/Statiq.Less/Statiq.Less.csproj
index 9a3e70dd5..8b6dbd5a4 100644
--- a/src/extensions/Statiq.Less/Statiq.Less.csproj
+++ b/src/extensions/Statiq.Less/Statiq.Less.csproj
@@ -2,6 +2,13 @@
Statiq is a configurable static content generation framework. This library provides support for parsing Less CSS content.
Statiq Static StaticContent StaticSite Blog BlogEngine CSS Less LessCSS
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
@@ -9,4 +16,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Lunr/Statiq.Lunr.csproj b/src/extensions/Statiq.Lunr/Statiq.Lunr.csproj
index 5d94bbba2..f9e56c1d6 100644
--- a/src/extensions/Statiq.Lunr/Statiq.Lunr.csproj
+++ b/src/extensions/Statiq.Lunr/Statiq.Lunr.csproj
@@ -2,6 +2,13 @@
Statiq is a configurable static content generation framework. This library provides support for creating search indexes.
Statiq Static StaticContent StaticSite Blog BlogEngine SearchIndex
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
@@ -9,4 +16,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Markdown/Statiq.Markdown.csproj b/src/extensions/Statiq.Markdown/Statiq.Markdown.csproj
index eade706bd..04fc0adf8 100644
--- a/src/extensions/Statiq.Markdown/Statiq.Markdown.csproj
+++ b/src/extensions/Statiq.Markdown/Statiq.Markdown.csproj
@@ -2,11 +2,21 @@
Statiq is a configurable static content generation framework. This library provides support for rendering Markdown content.
Statiq Static StaticContent StaticSite Blog BlogEngine Markdown
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
-
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Minification/Statiq.Minification.csproj b/src/extensions/Statiq.Minification/Statiq.Minification.csproj
index a4582e656..74b74fddb 100644
--- a/src/extensions/Statiq.Minification/Statiq.Minification.csproj
+++ b/src/extensions/Statiq.Minification/Statiq.Minification.csproj
@@ -2,6 +2,13 @@
Statiq is a configurable static content generation framework. This library provides support for minification of HTML, CSS and JavaScript content.
Statiq Static StaticContent StaticSite Blog BlogEngine HTML CSS JS WebMarkupMin
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
@@ -10,4 +17,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Razor/RazorEngineInitializer.cs b/src/extensions/Statiq.Razor/RazorEngineInitializer.cs
index 7792efd3a..e4469c0f0 100644
--- a/src/extensions/Statiq.Razor/RazorEngineInitializer.cs
+++ b/src/extensions/Statiq.Razor/RazorEngineInitializer.cs
@@ -1,4 +1,5 @@
-using Microsoft.Extensions.DependencyInjection;
+using System;
+using Microsoft.Extensions.DependencyInjection;
using Statiq.Common;
namespace Statiq.Razor
@@ -7,6 +8,7 @@ public class RazorEngineInitializer : IEngineInitializer
{
public void Initialize(IEngine engine)
{
+ ArgumentNullException.ThrowIfNull(engine);
RazorService razorService = engine.Services.GetRequiredService();
engine.Events.Subscribe(async args => await razorService.BeforeEngineExecutionAsync(args));
engine.Events.Subscribe(async args => await razorService.AfterEngineExecutionAsync(args));
diff --git a/src/extensions/Statiq.Razor/RenderRazor.cs b/src/extensions/Statiq.Razor/RenderRazor.cs
index e1e513b26..539c92bc1 100644
--- a/src/extensions/Statiq.Razor/RenderRazor.cs
+++ b/src/extensions/Statiq.Razor/RenderRazor.cs
@@ -181,6 +181,8 @@ public RenderRazor IgnorePrefix(string prefix)
///
protected override async Task> ExecuteContextAsync(IExecutionContext context)
{
+ ArgumentNullException.ThrowIfNull(context);
+
// Get the Razor service from the service collection if it's in there
RazorService razorService = context.GetRequiredService();
diff --git a/src/extensions/Statiq.Razor/Statiq.Razor.csproj b/src/extensions/Statiq.Razor/Statiq.Razor.csproj
index 0e62bdfa6..954edffd0 100644
--- a/src/extensions/Statiq.Razor/Statiq.Razor.csproj
+++ b/src/extensions/Statiq.Razor/Statiq.Razor.csproj
@@ -2,20 +2,29 @@
Statiq is a configurable static content generation framework. This library provides support for rendering Razor content.
Statiq Static StaticContent StaticSite Blog BlogEngine Razor
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1725;CS0809
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1725;CS0809
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Razor/StatiqRazorPage{TModel}.cs b/src/extensions/Statiq.Razor/StatiqRazorPage{TModel}.cs
index dfe6ec848..626eb05f7 100644
--- a/src/extensions/Statiq.Razor/StatiqRazorPage{TModel}.cs
+++ b/src/extensions/Statiq.Razor/StatiqRazorPage{TModel}.cs
@@ -52,6 +52,8 @@ protected IHtmlHelper GetHtmlHelper()
/// The HTML content.
public IHtmlContent RenderSection(string name, Func defaultContents)
{
+ ArgumentNullException.ThrowIfNull(defaultContents);
+
if (IsSectionDefined(name))
{
return RenderSection(name);
diff --git a/src/extensions/Statiq.Sass/FileImporter.cs b/src/extensions/Statiq.Sass/FileImporter.cs
index 183681859..d6d84f428 100644
--- a/src/extensions/Statiq.Sass/FileImporter.cs
+++ b/src/extensions/Statiq.Sass/FileImporter.cs
@@ -22,7 +22,7 @@ public FileImporter(IReadOnlyFileSystem fileSystem, Func importP
}
// This is a TryImportDelegate which unfortunately isn't async
- public bool TryImport(string requestedFile, string parentPath, out string scss, out string map)
+ public bool TryImport(ref string requestedFile, string parentPath, out string scss, out string map)
{
#pragma warning disable VSTHRD002 // Synchronously waiting on tasks or awaiters may cause deadlocks. Use await or JoinableTaskFactory.Run instead.
scss = TryImportAsync(requestedFile, parentPath).GetAwaiter().GetResult();
diff --git a/src/extensions/Statiq.Sass/Statiq.Sass.csproj b/src/extensions/Statiq.Sass/Statiq.Sass.csproj
index 346975ba8..5f58f30b9 100644
--- a/src/extensions/Statiq.Sass/Statiq.Sass.csproj
+++ b/src/extensions/Statiq.Sass/Statiq.Sass.csproj
@@ -2,11 +2,21 @@
Statiq is a configurable static content generation framework. This library provides support for parsing Sass CSS content.
Statiq Static StaticContent StaticSite Blog BlogEngine CSS Sass SassCSS
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
-
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Scriban/Statiq.Scriban.csproj b/src/extensions/Statiq.Scriban/Statiq.Scriban.csproj
index 3942ebacb..1790fe6bf 100644
--- a/src/extensions/Statiq.Scriban/Statiq.Scriban.csproj
+++ b/src/extensions/Statiq.Scriban/Statiq.Scriban.csproj
@@ -2,6 +2,13 @@
Statiq is a configurable static content generation framework. This library provides support for rendering Scriban and Liquid content.
Statiq Static StaticContent StaticSite Blog BlogEngine Scriban Liquid
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
@@ -9,4 +16,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Tables/Statiq.Tables.csproj b/src/extensions/Statiq.Tables/Statiq.Tables.csproj
index 14ac93840..54a0d1157 100644
--- a/src/extensions/Statiq.Tables/Statiq.Tables.csproj
+++ b/src/extensions/Statiq.Tables/Statiq.Tables.csproj
@@ -2,6 +2,13 @@
Statiq is a configurable static content generation framework. This library provides support for importing and exporting CSV and Excel files.
Statiq Static StaticContent StaticSite Blog BlogEngine CSV Excel
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
@@ -10,4 +17,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Xmp/Statiq.Xmp.csproj b/src/extensions/Statiq.Xmp/Statiq.Xmp.csproj
index c17d2e92a..5ff6ddd5d 100644
--- a/src/extensions/Statiq.Xmp/Statiq.Xmp.csproj
+++ b/src/extensions/Statiq.Xmp/Statiq.Xmp.csproj
@@ -2,13 +2,23 @@
Statiq is a configurable static content generation framework. This library provides support for analyzing XML metadata.
Statiq Static StaticContent StaticSite Blog BlogEngine XMP Metadata
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.Yaml/Statiq.Yaml.csproj b/src/extensions/Statiq.Yaml/Statiq.Yaml.csproj
index 082aae7c0..ea26c7f6b 100644
--- a/src/extensions/Statiq.Yaml/Statiq.Yaml.csproj
+++ b/src/extensions/Statiq.Yaml/Statiq.Yaml.csproj
@@ -2,11 +2,21 @@
Statiq is a configurable static content generation framework. This library provides support for parsing Yaml content.
Statiq Static StaticContent StaticSite Blog BlogEngine Yaml
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1725
-
+
+
+
+
\ No newline at end of file
diff --git a/src/extensions/Statiq.YouTube/Statiq.YouTube.csproj b/src/extensions/Statiq.YouTube/Statiq.YouTube.csproj
index fa28eb347..7f6c9e4ac 100644
--- a/src/extensions/Statiq.YouTube/Statiq.YouTube.csproj
+++ b/src/extensions/Statiq.YouTube/Statiq.YouTube.csproj
@@ -2,14 +2,18 @@
Statiq is a configurable static content generation framework. This library provides support for interacting with YouTube.
Statiq Static StaticContent StaticSite Blog BlogEngine YouTube
+ net8.0
-
-
-
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/core/Statiq.App.Tests/Statiq.App.Tests.csproj b/tests/core/Statiq.App.Tests/Statiq.App.Tests.csproj
index 6b4d528ef..d8dd8dbe2 100644
--- a/tests/core/Statiq.App.Tests/Statiq.App.Tests.csproj
+++ b/tests/core/Statiq.App.Tests/Statiq.App.Tests.csproj
@@ -1,6 +1,14 @@
+
+ net8.0
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/core/Statiq.Common.Tests/Documents/DocumentFixture.cs b/tests/core/Statiq.Common.Tests/Documents/DocumentFixture.cs
index fc0ec89f9..ee3847e1b 100644
--- a/tests/core/Statiq.Common.Tests/Documents/DocumentFixture.cs
+++ b/tests/core/Statiq.Common.Tests/Documents/DocumentFixture.cs
@@ -19,7 +19,7 @@ public void IdIsNotTheSameForDifferentDocuments()
Document b = new Document();
// Then
- Assert.AreNotEqual(a.Id, b.Id);
+ Assert.That(a.Id, Is.Not.EqualTo(b.Id));
}
[Test]
@@ -48,7 +48,7 @@ public void IdIsTheSameAfterClone()
IDocument cloned = document.Clone(null);
// Then
- Assert.AreEqual(document.Id, cloned.Id);
+ Assert.That(document.Id, Is.EqualTo(cloned.Id));
}
[Test]
diff --git a/tests/core/Statiq.Common.Tests/Documents/ObjectDocumentFixture.cs b/tests/core/Statiq.Common.Tests/Documents/ObjectDocumentFixture.cs
index 2631ca542..5e0cafd7d 100644
--- a/tests/core/Statiq.Common.Tests/Documents/ObjectDocumentFixture.cs
+++ b/tests/core/Statiq.Common.Tests/Documents/ObjectDocumentFixture.cs
@@ -19,7 +19,7 @@ public void IdIsNotTheSameForDifferentDocuments()
IDocument b = new ObjectDocument(obj);
// Then
- Assert.AreNotEqual(a.Id, b.Id);
+ Assert.That(a.Id, Is.Not.EqualTo(b.Id));
}
}
@@ -36,7 +36,7 @@ public void IdIsTheSameAfterClone()
IDocument cloned = document.Clone(null);
// Then
- Assert.AreEqual(document.Id, cloned.Id);
+ Assert.That(document.Id, Is.EqualTo(cloned.Id));
}
[Test]
diff --git a/tests/core/Statiq.Common.Tests/Documents/ToLookupExtensionsFixture.cs b/tests/core/Statiq.Common.Tests/Documents/ToLookupExtensionsFixture.cs
index 4d4030278..8a8144c80 100644
--- a/tests/core/Statiq.Common.Tests/Documents/ToLookupExtensionsFixture.cs
+++ b/tests/core/Statiq.Common.Tests/Documents/ToLookupExtensionsFixture.cs
@@ -36,11 +36,11 @@ public void ReturnsCorrectLookupOfInt()
ILookup lookup = documents.ToLookupMany("Numbers");
// Then
- Assert.AreEqual(4, lookup.Count);
- CollectionAssert.AreEquivalent(new[] { a }, lookup[1]);
- CollectionAssert.AreEquivalent(new[] { a, b }, lookup[2]);
- CollectionAssert.AreEquivalent(new[] { a, b, c }, lookup[3]);
- CollectionAssert.AreEquivalent(new[] { b, d }, lookup[4]);
+ Assert.That(lookup.Count, Is.EqualTo(4));
+ Assert.That(lookup[1], Is.EquivalentTo(new[] { a }));
+ Assert.That(lookup[2], Is.EquivalentTo(new[] { a, b }));
+ Assert.That(lookup[3], Is.EquivalentTo(new[] { a, b, c }));
+ Assert.That(lookup[4], Is.EquivalentTo(new[] { b, d }));
}
[Test]
@@ -69,11 +69,11 @@ public void ReturnsCorrectLookupOfString()
ILookup lookup = documents.ToLookupMany("Numbers");
// Then
- Assert.AreEqual(4, lookup.Count);
- CollectionAssert.AreEquivalent(new[] { a }, lookup["1"]);
- CollectionAssert.AreEquivalent(new[] { a, b }, lookup["2"]);
- CollectionAssert.AreEquivalent(new[] { a, b, c }, lookup["3"]);
- CollectionAssert.AreEquivalent(new[] { b, d }, lookup["4"]);
+ Assert.That(lookup.Count, Is.EqualTo(4));
+ Assert.That(lookup["1"], Is.EquivalentTo(new[] { a }));
+ Assert.That(lookup["2"], Is.EquivalentTo(new[] { a, b }));
+ Assert.That(lookup["3"], Is.EquivalentTo(new[] { a, b, c }));
+ Assert.That(lookup["4"], Is.EquivalentTo(new[] { b, d }));
}
[Test]
@@ -106,11 +106,11 @@ public void ReturnsCorrectLookupWithValues()
ILookup lookup = documents.ToLookupMany("Numbers", "Colors");
// Then
- Assert.AreEqual(4, lookup.Count);
- CollectionAssert.AreEquivalent(new[] { "Red" }, lookup[1]);
- CollectionAssert.AreEquivalent(new[] { "Red", "Red" }, lookup[2]);
- CollectionAssert.AreEquivalent(new[] { "Red", "Red", "Green" }, lookup[3]);
- CollectionAssert.AreEquivalent(new[] { "Red", "Green" }, lookup[4]);
+ Assert.That(lookup.Count, Is.EqualTo(4));
+ Assert.That(lookup[1], Is.EquivalentTo(new[] { "Red" }));
+ Assert.That(lookup[2], Is.EquivalentTo(new[] { "Red", "Red" }));
+ Assert.That(lookup[3], Is.EquivalentTo(new[] { "Red", "Red", "Green" }));
+ Assert.That(lookup[4], Is.EquivalentTo(new[] { "Red", "Green" }));
}
}
@@ -146,11 +146,11 @@ public void ReturnsCorrectLookupWithValues()
ILookup lookup = documents.ToLookupManyToMany("Numbers", "Colors");
// Then
- Assert.AreEqual(4, lookup.Count);
- CollectionAssert.AreEquivalent(new[] { "Red" }, lookup[1]);
- CollectionAssert.AreEquivalent(new[] { "Red", "Red", "Blue" }, lookup[2]);
- CollectionAssert.AreEquivalent(new[] { "Red", "Red", "Blue", "Green" }, lookup[3]);
- CollectionAssert.AreEquivalent(new[] { "Red", "Blue", "Green", "Blue" }, lookup[4]);
+ Assert.That(lookup.Count, Is.EqualTo(4));
+ Assert.That(lookup[1], Is.EquivalentTo(new[] { "Red" }));
+ Assert.That(lookup[2], Is.EquivalentTo(new[] { "Red", "Red", "Blue" }));
+ Assert.That(lookup[3], Is.EquivalentTo(new[] { "Red", "Red", "Blue", "Green" }));
+ Assert.That(lookup[4], Is.EquivalentTo(new[] { "Red", "Blue", "Green", "Blue" }));
}
}
}
diff --git a/tests/core/Statiq.Common.Tests/IO/Globbing/GlobberFixture.cs b/tests/core/Statiq.Common.Tests/IO/Globbing/GlobberFixture.cs
index 0fd7420f5..65353abee 100644
--- a/tests/core/Statiq.Common.Tests/IO/Globbing/GlobberFixture.cs
+++ b/tests/core/Statiq.Common.Tests/IO/Globbing/GlobberFixture.cs
@@ -49,8 +49,8 @@ public void ShouldReturnMatchedFiles(string directoryPath, string[] patterns, st
IEnumerable matchesReversedSlash = Globber.GetFiles(directory, patterns.Select(x => x.Replace("/", "\\")));
// Then
- CollectionAssert.AreEquivalent(resultPaths, matches.Select(x => x.Path.FullPath));
- CollectionAssert.AreEquivalent(resultPaths, matchesReversedSlash.Select(x => x.Path.FullPath));
+ Assert.That(matches.Select(x => x.Path.FullPath), Is.EquivalentTo(resultPaths));
+ Assert.That(matchesReversedSlash.Select(x => x.Path.FullPath), Is.EquivalentTo(resultPaths));
}
[Test]
@@ -110,8 +110,8 @@ public void RecursiveWildcardTests(string directoryPath, string[] patterns, stri
IEnumerable matchesReversedSlash = Globber.GetFiles(directory, patterns.Select(x => x.Replace("/", "\\")));
// Then
- CollectionAssert.AreEquivalent(resultPaths, matches.Select(x => x.Path.FullPath));
- CollectionAssert.AreEquivalent(resultPaths, matchesReversedSlash.Select(x => x.Path.FullPath));
+ Assert.That(matches.Select(x => x.Path.FullPath), Is.EquivalentTo(resultPaths));
+ Assert.That(matchesReversedSlash.Select(x => x.Path.FullPath), Is.EquivalentTo(resultPaths));
}
// Addresses a specific problem with nested folders in a wildcard search
@@ -132,7 +132,7 @@ public void NestedFoldersWilcard()
IEnumerable matches = Globber.GetFiles(directory, new[] { "**/*.txt" });
// Then
- CollectionAssert.AreEquivalent(new[] { "/a/b/c/x.txt", "/a/bar/foo/y.txt" }, matches.Select(x => x.Path.FullPath));
+ Assert.That(matches.Select(x => x.Path.FullPath), Is.EquivalentTo(new[] { "/a/b/c/x.txt", "/a/bar/foo/y.txt" }));
}
[TestCase("/a/b")]
@@ -224,7 +224,7 @@ public void ShouldExpandBraces(string pattern, string[] expected)
IEnumerable result = Globber.ExpandBraces(pattern);
// Then
- CollectionAssert.AreEquivalent(expected, result);
+ Assert.That(result, Is.EquivalentTo(expected));
}
}
diff --git a/tests/core/Statiq.Common.Tests/IO/IReadOnlyFileSystemExtensionsFixture.cs b/tests/core/Statiq.Common.Tests/IO/IReadOnlyFileSystemExtensionsFixture.cs
index 68a19b9c2..7df61ffee 100644
--- a/tests/core/Statiq.Common.Tests/IO/IReadOnlyFileSystemExtensionsFixture.cs
+++ b/tests/core/Statiq.Common.Tests/IO/IReadOnlyFileSystemExtensionsFixture.cs
@@ -32,7 +32,7 @@ public void ReturnsInputFile(string input, string expected)
IFile result = fileSystem.GetInputFile(input);
// Then
- Assert.AreEqual(expected, result.Path.FullPath);
+ Assert.That(result.Path.FullPath, Is.EqualTo(expected));
}
[Test]
@@ -47,7 +47,7 @@ public void ReturnsInputFileAboveInputDirectory()
IFile result = fileSystem.GetInputFile("../bar.txt");
// Then
- Assert.AreEqual("/a/x/bar.txt", result.Path.FullPath);
+ Assert.That(result.Path.FullPath, Is.EqualTo("/a/x/bar.txt"));
}
[Test]
@@ -62,7 +62,7 @@ public void ReturnsInputFileWhenInputDirectoryAboveRoot()
IFile result = fileSystem.GetInputFile("bar.txt");
// Then
- Assert.AreEqual("/a/x/bar.txt", result.Path.FullPath);
+ Assert.That(result.Path.FullPath, Is.EqualTo("/a/x/bar.txt"));
}
[Test]
@@ -77,7 +77,7 @@ public void ReturnsInputFileWhenInputDirectoryAndFileAscend()
IFile result = fileSystem.GetInputFile("../bar.txt");
// Then
- Assert.AreEqual("/a/x/bar.txt", result.Path.FullPath);
+ Assert.That(result.Path.FullPath, Is.EqualTo("/a/x/bar.txt"));
}
}
@@ -93,8 +93,8 @@ public void ReturnsVirtualInputDirectoryForRelativePath()
IDirectory result = fileSystem.GetInputDirectory("A/B/C");
// Then
- Assert.IsInstanceOf(result);
- Assert.AreEqual("A/B/C", result.Path.FullPath);
+ Assert.That(result, Is.InstanceOf());
+ Assert.That(result.Path.FullPath, Is.EqualTo("A/B/C"));
}
[Test]
@@ -107,8 +107,8 @@ public void ReturnsVirtualInputDirectoryForAscendingPath()
IDirectory result = fileSystem.GetInputDirectory("../A/B/C");
// Then
- Assert.IsInstanceOf(result);
- Assert.AreEqual("../A/B/C", result.Path.FullPath);
+ Assert.That(result, Is.InstanceOf());
+ Assert.That(result.Path.FullPath, Is.EqualTo("../A/B/C"));
}
[Test]
@@ -121,8 +121,8 @@ public void ReturnsVirtualInputDirectoryForNullPath()
IDirectory result = fileSystem.GetInputDirectory();
// Then
- Assert.IsInstanceOf(result);
- Assert.AreEqual(string.Empty, result.Path.FullPath);
+ Assert.That(result, Is.InstanceOf());
+ Assert.That(result.Path.FullPath, Is.EqualTo(string.Empty));
}
[Test]
@@ -135,7 +135,7 @@ public void ReturnsDirectoryForAbsolutePath()
IDirectory result = fileSystem.GetInputDirectory("/A/B/C");
// Then
- Assert.AreEqual("/A/B/C", result.Path.FullPath);
+ Assert.That("/A/B/C", Is.EqualTo(result.Path.FullPath));
}
}
@@ -158,8 +158,7 @@ public void ReturnsCombinedInputDirectories()
IEnumerable result = fileSystem.GetInputDirectories();
// Then
- CollectionAssert.AreEquivalent(
- new[]
+ Assert.That(result.Select(x => x.Path.FullPath), Is.EquivalentTo(new[]
{
"/a/theme",
"/a/input",
@@ -168,7 +167,7 @@ public void ReturnsCombinedInputDirectories()
"/a/x",
"/a/y",
"/z"
- }, result.Select(x => x.Path.FullPath));
+ }));
}
}
@@ -438,7 +437,7 @@ public void ShouldNotThrowForNullPattern()
IEnumerable results = fileSystem.GetFiles(dir, null, "**/foo.txt");
// Then
- CollectionAssert.AreEquivalent(new[] { "/a/b/c/foo.txt" }, results.Select(x => x.Path.FullPath));
+ Assert.That(results.Select(x => x.Path.FullPath), Is.EquivalentTo(new[] { "/a/b/c/foo.txt" }));
}
[TestCase("/", new[] { "/a/b/c/foo.txt" }, new[] { "/a/b/c/foo.txt" }, true)]
@@ -486,7 +485,7 @@ public void ShouldReturnExistingFiles(string directory, string[] patterns, strin
IEnumerable results = fileSystem.GetFiles(dir, patterns);
// Then
- CollectionAssert.AreEquivalent(expected, results.Select(x => x.Path.FullPath));
+ Assert.That(results.Select(x => x.Path.FullPath), Is.EquivalentTo(expected));
if (reverseSlashes)
{
@@ -494,7 +493,7 @@ public void ShouldReturnExistingFiles(string directory, string[] patterns, strin
results = fileSystem.GetFiles(dir, patterns.Select(x => x.Replace("/", "\\")));
// Then
- CollectionAssert.AreEquivalent(expected, results.Select(x => x.Path.FullPath));
+ Assert.That(results.Select(x => x.Path.FullPath), Is.EquivalentTo(expected));
}
}
@@ -526,7 +525,7 @@ public void ShouldNotReturnExcludedFiles(string directory, string excluded, stri
IEnumerable results = fileSystem.GetFiles(dir, patterns);
// Then
- CollectionAssert.AreEquivalent(expected, results.Select(x => x.Path.FullPath));
+ Assert.That(results.Select(x => x.Path.FullPath), Is.EquivalentTo(expected));
}
}
diff --git a/tests/core/Statiq.Common.Tests/IO/NormalizedPathFixture.cs b/tests/core/Statiq.Common.Tests/IO/NormalizedPathFixture.cs
index 2a4b32733..a23a178ee 100644
--- a/tests/core/Statiq.Common.Tests/IO/NormalizedPathFixture.cs
+++ b/tests/core/Statiq.Common.Tests/IO/NormalizedPathFixture.cs
@@ -1,7 +1,9 @@
using System;
+using System.IO;
using NUnit.Framework;
using Shouldly;
using Statiq.Testing;
+using static Microsoft.CodeAnalysis.CSharp.SyntaxTokenParser;
namespace Statiq.Common.Tests.IO
{
@@ -591,7 +593,7 @@ public void CanSeeIfAPathHasAnExtension(string fullPath, bool expected)
NormalizedPath path = new NormalizedPath(fullPath);
// Then
- Assert.AreEqual(expected, path.HasExtension);
+ Assert.That(path.HasExtension, Is.EqualTo(expected));
}
}
@@ -610,7 +612,7 @@ public void CanGetExtension(string fullPath, string expected)
string extension = result.Extension;
// Then
- Assert.AreEqual(expected, extension);
+ Assert.That(extension, Is.EqualTo(expected));
}
}
@@ -626,7 +628,7 @@ public void CanGetDirectoryForFilePath()
NormalizedPath directory = path.Parent;
// Then
- Assert.AreEqual("temp", directory.FullPath);
+ Assert.That(directory.FullPath, Is.EqualTo("temp"));
}
[Test]
@@ -662,7 +664,7 @@ public void ShouldReturnRootRelativePath(string fullPath, string expected)
NormalizedPath rootRelative = path.RootRelative;
// Then
- Assert.AreEqual(expected, rootRelative.FullPath);
+ Assert.That(rootRelative.FullPath, Is.EqualTo(expected));
}
[TestCase(@"\a\b\c")]
@@ -682,7 +684,7 @@ public void ShouldReturnSelfForExplicitRelativePath(string fullPath)
NormalizedPath rootRelative = path.RootRelative;
// Then
- Assert.AreEqual(path.FullPath, rootRelative.FullPath);
+ Assert.That(rootRelative.FullPath, Is.EqualTo(path.FullPath));
}
}
@@ -711,7 +713,7 @@ public void ShouldChangeExtension(string path, string extension, string expected
normalized = normalized.ChangeExtension(extension);
// Then
- Assert.AreEqual(expected, normalized.ToString());
+ Assert.That(normalized.ToString(), Is.EqualTo(expected));
}
[TestCase("foo")]
@@ -755,7 +757,7 @@ public void CanAppendExtensionToPath(string extension, string expected)
path = path.AppendExtension(extension);
// Then
- Assert.AreEqual(expected, path.ToString());
+ Assert.That(path.ToString(), Is.EqualTo(expected));
}
}
@@ -787,7 +789,7 @@ public void CanInsertSuffixToPath(string path, string suffix, string expected)
filePath = filePath.InsertSuffix(suffix);
// Then
- Assert.AreEqual(expected, filePath.FullPath);
+ Assert.That(filePath.FullPath, Is.EqualTo(expected));
}
}
@@ -820,7 +822,7 @@ public void CanInsertPrefixToPath(string path, string prefix, string expected)
filePath = filePath.InsertPrefix(prefix);
// Then
- Assert.AreEqual(expected, filePath.FullPath);
+ Assert.That(filePath.FullPath, Is.EqualTo(expected));
}
}
@@ -985,7 +987,7 @@ public void ShouldReturnDirectoryName(string directoryPath, string name)
string result = path.Name;
// Then
- Assert.AreEqual(name, result);
+ Assert.That(result, Is.EqualTo(name));
}
}
@@ -1006,7 +1008,7 @@ public void ReturnsParent(string directoryPath, string expected)
NormalizedPath parent = path.Parent;
// Then
- Assert.AreEqual(expected, parent.FullPath);
+ Assert.That(parent.FullPath, Is.EqualTo(expected));
}
[TestCase(".")]
@@ -1078,7 +1080,7 @@ public void ShouldCombinePaths(string first, string second, string expected)
NormalizedPath result = path.GetFilePath(new NormalizedPath(second));
// Then
- Assert.AreEqual(expected, result.FullPath);
+ Assert.That(result.FullPath, Is.EqualTo(expected));
}
}
@@ -1121,7 +1123,7 @@ public void ShouldCombinePaths(string first, string second, string expected)
NormalizedPath result = path.Combine(new NormalizedPath(second));
// Then
- Assert.AreEqual(expected, result.FullPath);
+ Assert.That(result.FullPath, Is.EqualTo(expected));
}
}
diff --git a/tests/core/Statiq.Common.Tests/IO/PathCollectionFixture.cs b/tests/core/Statiq.Common.Tests/IO/PathCollectionFixture.cs
index de2f50957..075bc2318 100644
--- a/tests/core/Statiq.Common.Tests/IO/PathCollectionFixture.cs
+++ b/tests/core/Statiq.Common.Tests/IO/PathCollectionFixture.cs
@@ -49,7 +49,7 @@ public void ShouldReturnTheNumberOfPathsInTheCollection()
PathCollection collection = new PathCollection(new[] { _upperCaseA, _upperCaseB });
// When, Then
- Assert.AreEqual(2, collection.Count);
+ Assert.That(collection.Count, Is.EqualTo(2));
}
}
@@ -66,7 +66,7 @@ public void ShouldAddPathIfNotAlreadyPresent()
collection.Add(_upperCaseA);
// Then
- Assert.AreEqual(2, collection.Count);
+ Assert.That(collection.Count, Is.EqualTo(2));
}
}
@@ -83,7 +83,7 @@ public void ShouldAddPathsThatAreNotPresent()
collection.AddRange(new[] { _upperCaseA, _upperCaseB, _upperCaseC });
// Then
- Assert.AreEqual(3, collection.Count);
+ Assert.That(collection.Count, Is.EqualTo(3));
}
}
}
diff --git a/tests/core/Statiq.Common.Tests/IO/VirtualInputDirectoryFixture.cs b/tests/core/Statiq.Common.Tests/IO/VirtualInputDirectoryFixture.cs
index 7e1811e64..0990a7e90 100644
--- a/tests/core/Statiq.Common.Tests/IO/VirtualInputDirectoryFixture.cs
+++ b/tests/core/Statiq.Common.Tests/IO/VirtualInputDirectoryFixture.cs
@@ -49,7 +49,7 @@ public void RootVirtualDirectoryDoesNotIncludeSelf(string virtualPath, SearchOpt
IEnumerable directories = directory.GetDirectories(searchOption);
// Then
- CollectionAssert.AreEquivalent(expectedPaths, directories.Select(x => x.Path.FullPath));
+ Assert.That(directories.Select(x => x.Path.FullPath), Is.EquivalentTo(expectedPaths));
}
[TestCase("a", SearchOption.AllDirectories, new[] { "a/b" })]
@@ -63,7 +63,7 @@ public void NonRootVirtualDirectoryIncludesSelf(string virtualPath, SearchOption
IEnumerable directories = directory.GetDirectories(searchOption);
// Then
- CollectionAssert.AreEquivalent(expectedPaths, directories.Select(x => x.Path.FullPath));
+ Assert.That(directories.Select(x => x.Path.FullPath), Is.EquivalentTo(expectedPaths));
}
[TestCase("", SearchOption.TopDirectoryOnly, new[] { "x", "i" })]
@@ -126,7 +126,7 @@ public void GetsFiles(string virtualPath, SearchOption searchOption, string[] ex
IEnumerable files = directory.GetFiles(searchOption);
// Then
- CollectionAssert.AreEquivalent(expectedPaths, files.Select(x => x.Path.FullPath));
+ Assert.That(files.Select(x => x.Path.FullPath), Is.EquivalentTo(expectedPaths));
}
[TestCase("", SearchOption.TopDirectoryOnly, new string[] { })]
@@ -173,8 +173,8 @@ public void GetsInputFile(string virtualPath, string filePath, string expectedPa
IFile file = directory.GetFile(filePath);
// Then
- Assert.AreEqual(expectedPath, file.Path.FullPath);
- Assert.AreEqual(expectedExists, file.Exists);
+ Assert.That(file.Path.FullPath, Is.EqualTo(expectedPath));
+ Assert.That(file.Exists, Is.EqualTo(expectedExists));
}
[TestCase("", "x/y/z/foo.txt", "/root/a/x/y/z/foo.txt", true)]
@@ -203,8 +203,8 @@ public void GetsMappedInputFile(string virtualPath, string filePath, string expe
IFile file = directory.GetFile(filePath);
// Then
- Assert.AreEqual(expectedPath, file.Path.FullPath);
- Assert.AreEqual(expectedExists, file.Exists);
+ Assert.That(file.Path.FullPath, Is.EqualTo(expectedPath));
+ Assert.That(file.Exists, Is.EqualTo(expectedExists));
}
[Test]
@@ -221,7 +221,7 @@ public void GetsInputFileAboveInputDirectory()
IFile file = directory.GetFile("../c/foo.txt");
// Then
- Assert.AreEqual("/a/b/c/foo.txt", file.Path.FullPath);
+ Assert.That(file.Path.FullPath, Is.EqualTo("/a/b/c/foo.txt"));
}
[Test]
@@ -234,7 +234,7 @@ public void GetsMappedInputFileAboveInputDirectory()
IFile file = directory.GetFile("../../z/fizz.txt");
// Then
- Assert.AreEqual("/root/c/z/fizz.txt", file.Path.FullPath);
+ Assert.That(file.Path.FullPath, Is.EqualTo("/root/c/z/fizz.txt"));
}
[Test]
@@ -293,7 +293,7 @@ public void ShouldReturnDirectory(string virtualPath, string path, string expect
IDirectory result = directory.GetDirectory(path);
// Then
- Assert.AreEqual(expected, result.Path.FullPath);
+ Assert.That(result.Path.FullPath, Is.EqualTo(expected));
}
[Test]
@@ -333,7 +333,7 @@ public void ShouldReturnParentDirectory(string virtualPath, string expected)
IDirectory result = directory.Parent;
// Then
- Assert.AreEqual(expected, result?.Path.FullPath);
+ Assert.That(result?.Path.FullPath, Is.EquivalentTo(expected));
}
}
diff --git a/tests/core/Statiq.Common.Tests/Meta/MetadataFixture.cs b/tests/core/Statiq.Common.Tests/Meta/MetadataFixture.cs
index f2ba5c093..89decb277 100644
--- a/tests/core/Statiq.Common.Tests/Meta/MetadataFixture.cs
+++ b/tests/core/Statiq.Common.Tests/Meta/MetadataFixture.cs
@@ -60,7 +60,7 @@ public void ReturnsCorrectResultWithMetadataValue()
object value = metadata["A"];
// Then
- Assert.AreEqual("a", value);
+ Assert.That(value, Is.EquivalentTo("a"));
}
[Test]
@@ -77,7 +77,7 @@ public void ReturnsCorrectResultForKeysWithDifferentCase()
object value = metadata["a"];
// Then
- Assert.AreEqual("a", value);
+ Assert.That(value, Is.EquivalentTo("a"));
}
}
@@ -94,7 +94,7 @@ public void ReturnsTrueForValidValue()
bool contains = metadata.ContainsKey("A");
// Then
- Assert.IsTrue(contains);
+ Assert.That(contains, Is.True);
}
[Test]
@@ -108,7 +108,7 @@ public void ReturnsFalseForInvalidValue()
bool contains = metadata.ContainsKey("B");
// Then
- Assert.IsFalse(contains);
+ Assert.That(contains, Is.False);
}
[Test]
@@ -122,7 +122,7 @@ public void ReturnsTrueForSameKeysWithDifferentCase()
bool contains = metadata.ContainsKey("a");
// Then
- Assert.IsTrue(contains);
+ Assert.That(contains, Is.True);
}
}
@@ -140,8 +140,8 @@ public void ReturnsTrueForValidValue()
bool contains = metadata.TryGetValue("A", out value);
// Then
- Assert.IsTrue(contains);
- Assert.AreEqual("a", value);
+ Assert.That(contains, Is.True);
+ Assert.That(value, Is.EqualTo("a"));
}
[Test]
@@ -156,8 +156,8 @@ public void ReturnsFalseForInvalidValue()
bool contains = metadata.TryGetValue("B", out value);
// Then
- Assert.IsFalse(contains);
- Assert.AreEqual(null, value);
+ Assert.That(contains, Is.False);
+ Assert.That(value, Is.Null);
}
[Test]
@@ -175,8 +175,8 @@ public void ReturnsCorrectResultWithMetadataValue()
bool contains = metadata.TryGetValue("A", out value);
// Then
- Assert.IsTrue(contains);
- Assert.AreEqual("a", value);
+ Assert.That(contains, Is.True);
+ Assert.That(value, Is.EqualTo("a"));
}
}
@@ -193,7 +193,7 @@ public void CanCloneWithNewValues()
metadata = new Metadata(metadata, new[] { new KeyValuePair("A", "a") });
// Then
- Assert.AreEqual("a", metadata["A"]);
+ Assert.That(metadata["A"], Is.EqualTo("a"));
}
[Test]
@@ -207,7 +207,7 @@ public void ContainsPreviousValues()
Metadata clone = new Metadata(metadata, new Dictionary { { "B", "b" } });
// Then
- Assert.AreEqual("a", clone["A"]);
+ Assert.That(clone["A"], Is.EqualTo("a"));
}
[Test]
@@ -221,7 +221,7 @@ public void ClonedMetadataDoesNotContainNewValues()
Metadata clone = new Metadata(metadata, new Dictionary { { "B", "b" } });
// Then
- Assert.IsFalse(metadata.ContainsKey("B"));
+ Assert.That(metadata.ContainsKey("B"), Is.False);
}
[Test]
@@ -235,7 +235,7 @@ public void ContainsNewValues()
Metadata clone = new Metadata(metadata, new Dictionary { { "B", "b" } });
// Then
- Assert.AreEqual("b", clone["B"]);
+ Assert.That(clone["B"], Is.EqualTo("b"));
}
[Test]
@@ -249,8 +249,8 @@ public void ReplacesValue()
Metadata clone = new Metadata(metadata, new Dictionary { { "A", "b" } });
// Then
- Assert.AreEqual("a", metadata["A"]);
- Assert.AreEqual("b", clone["A"]);
+ Assert.That(metadata["A"], Is.EqualTo("a"));
+ Assert.That(clone["A"], Is.EqualTo("b"));
}
}
@@ -267,7 +267,7 @@ public void GetWithMetadataValueReturnsCorrectResult()
object value = metadata.Get("A");
// Then
- Assert.AreEqual("a", value);
+ Assert.That(value, Is.EqualTo("a"));
}
[Test]
@@ -285,7 +285,7 @@ public void ReturnsCorrectResultWithDerivedMetadataValue()
object value = metadata.Get("A");
// Then
- Assert.AreEqual("x", value);
+ Assert.That(value, Is.EqualTo("x"));
}
[Test]
@@ -302,8 +302,8 @@ public void MetadataValueCalledForEachRequest()
value = metadata.Get("A");
// Then
- Assert.AreEqual("a", value);
- Assert.AreEqual(3, metadataValue.Calls);
+ Assert.That(value, Is.EqualTo("a"));
+ Assert.That(metadataValue.Calls, Is.EqualTo(3));
}
}
@@ -320,8 +320,8 @@ public void ReturnsCorrectResultForList()
IReadOnlyList result = metadata.GetList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.AreEqual(result, new[] { 1, 2, 3 });
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.EqualTo(new[] { 1, 2, 3 }));
}
[Test]
@@ -335,8 +335,8 @@ public void ReturnsCorrectResultForConvertedStringList()
IReadOnlyList result = metadata.GetList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.AreEqual(result, new[] { 1, 2, 3 });
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.EqualTo(new[] { 1, 2, 3 }));
}
[Test]
@@ -350,8 +350,8 @@ public void ReturnsCorrectResultForConvertedIntList()
IReadOnlyList result = metadata.GetList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.AreEqual(result, new[] { "1", "2", "3" });
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.EqualTo(new[] { "1", "2", "3" }));
}
[Test]
@@ -365,8 +365,8 @@ public void ReturnsCorrectResultForArray()
IReadOnlyList result = metadata.GetList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.AreEqual(result, new[] { 1, 2, 3 });
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.EqualTo(new[] { 1, 2, 3 }));
}
}
@@ -400,8 +400,8 @@ public void ReturnsListForList()
IEnumerable result = metadata.GetDocuments("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.AreEqual(new[] { a, b, c }, result);
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.EquivalentTo(new[] { a, b, c }));
}
[Test]
@@ -415,8 +415,8 @@ public void ReturnsEmptyListForListOfInt()
IEnumerable result = metadata.GetDocuments("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.IsEmpty(result);
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.Empty);
}
[Test]
@@ -430,8 +430,8 @@ public void ReturnsEmptyListForSingleInt()
IEnumerable result = metadata.GetDocuments("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.IsEmpty(result);
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.Empty);
}
}
@@ -448,7 +448,7 @@ public void ReturnsEmptyListWhenKeyNotFound()
DocumentList result = metadata.GetDocumentList("A");
// Then
- Assert.IsEmpty(result);
+ Assert.That(result, Is.Empty);
}
[Test]
@@ -465,8 +465,8 @@ public void ReturnsListForList()
DocumentList result = metadata.GetDocumentList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.AreEqual(new[] { a, b, c }, result);
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.EquivalentTo(new[] { a, b, c }));
}
[Test]
@@ -480,8 +480,8 @@ public void ReturnsEmptyListForListOfInt()
DocumentList result = metadata.GetDocumentList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.IsEmpty(result);
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.Empty);
}
[Test]
@@ -495,8 +495,8 @@ public void ReturnsEmptyListForSingleInt()
DocumentList result = metadata.GetDocumentList("A");
// Then
- Assert.IsNotNull(result);
- CollectionAssert.IsEmpty(result);
+ Assert.That(result, Is.Not.Null);
+ Assert.That(result, Is.Empty);
}
}
@@ -515,8 +515,8 @@ public void ReturnsCorrectStringForFilePath(string path, string expected)
object result = metadata.GetString("A");
// Then
- Assert.IsInstanceOf(result);
- Assert.AreEqual(expected, result);
+ Assert.That(result, Is.InstanceOf());
+ Assert.That(result, Is.EquivalentTo(expected));
}
[TestCase("/a/b/c", "/a/b/c")]
@@ -532,8 +532,8 @@ public void ReturnsCorrectStringForDirectoryPath(string path, string expected)
object result = metadata.GetString("A");
// Then
- Assert.IsInstanceOf(result);
- Assert.AreEqual(expected, result);
+ Assert.That(result, Is.InstanceOf());
+ Assert.That(result, Is.EquivalentTo(expected));
}
}
@@ -638,7 +638,7 @@ public void EnumeratingMetadataValuesReturnsCorrectResults()
object[] values = metadata.Select(x => x.Value).ToArray();
// Then
- CollectionAssert.AreEquivalent(new[] { "a", "b", "c" }, values);
+ Assert.That(values, Is.EquivalentTo(new[] { "a", "b", "c" }));
}
}
diff --git a/tests/core/Statiq.Common.Tests/Modules/ModuleListFixture.cs b/tests/core/Statiq.Common.Tests/Modules/ModuleListFixture.cs
index 62cff539f..a9fc050ec 100644
--- a/tests/core/Statiq.Common.Tests/Modules/ModuleListFixture.cs
+++ b/tests/core/Statiq.Common.Tests/Modules/ModuleListFixture.cs
@@ -159,10 +159,10 @@ public void InsertAfterFirst()
collection.InsertAfterFirst(new CountModule("foo"));
// Then
- Assert.AreEqual(collection[0].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[1].GetType(), typeof(CountModule));
- Assert.AreEqual(collection[2].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[3].GetType(), typeof(GreenModule));
+ Assert.That(collection[0].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[1].GetType(), Is.EqualTo(typeof(CountModule)));
+ Assert.That(collection[2].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[3].GetType(), Is.EqualTo(typeof(GreenModule)));
}
}
@@ -181,10 +181,10 @@ public void InsertBeforeFirst()
collection.InsertBeforeFirst(new CountModule("foo"));
// Then
- Assert.AreEqual(collection[0].GetType(), typeof(CountModule));
- Assert.AreEqual(collection[1].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[2].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[3].GetType(), typeof(GreenModule));
+ Assert.That(collection[0].GetType(), Is.EqualTo(typeof(CountModule)));
+ Assert.That(collection[1].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[2].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[3].GetType(), Is.EqualTo(typeof(GreenModule)));
}
}
@@ -203,10 +203,10 @@ public void InsertAfterLast()
collection.InsertAfterLast(new CountModule("foo"));
// Then
- Assert.AreEqual(collection[0].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[1].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[2].GetType(), typeof(CountModule));
- Assert.AreEqual(collection[3].GetType(), typeof(GreenModule));
+ Assert.That(collection[0].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[1].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[2].GetType(), Is.EqualTo(typeof(CountModule)));
+ Assert.That(collection[3].GetType(), Is.EqualTo(typeof(GreenModule)));
}
}
@@ -225,10 +225,10 @@ public void InsertBeforeLast()
collection.InsertBeforeLast(new CountModule("foo"));
// Then
- Assert.AreEqual(collection[0].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[1].GetType(), typeof(CountModule));
- Assert.AreEqual(collection[2].GetType(), typeof(RedModule));
- Assert.AreEqual(collection[3].GetType(), typeof(GreenModule));
+ Assert.That(collection[0].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[1].GetType(), Is.EqualTo(typeof(CountModule)));
+ Assert.That(collection[2].GetType(), Is.EqualTo(typeof(RedModule)));
+ Assert.That(collection[3].GetType(), Is.EqualTo(typeof(GreenModule)));
}
}
@@ -248,8 +248,8 @@ public void ReplaceFirst()
collection.ReplaceFirst(new CountModule("replacedKey"));
// Then
- Assert.AreEqual("replacedKey", ((CountModule)collection[1]).ValueKey);
- Assert.AreEqual("mykey2", ((CountModule)collection[2]).ValueKey);
+ Assert.That(((CountModule)collection[1]).ValueKey, Is.EqualTo("replacedKey"));
+ Assert.That(((CountModule)collection[2]).ValueKey, Is.EqualTo("mykey2"));
}
}
@@ -269,8 +269,8 @@ public void ReplaceLast()
collection.ReplaceLast(new CountModule("replacedKey"));
// Then
- Assert.AreEqual("mykey1", ((CountModule)collection[1]).ValueKey);
- Assert.AreEqual("replacedKey", ((CountModule)collection[2]).ValueKey);
+ Assert.That(((CountModule)collection[1]).ValueKey, Is.EqualTo("mykey1"));
+ Assert.That(((CountModule)collection[2]).ValueKey, Is.EqualTo("replacedKey"));
}
}
diff --git a/tests/core/Statiq.Common.Tests/Statiq.Common.Tests.csproj b/tests/core/Statiq.Common.Tests/Statiq.Common.Tests.csproj
index 1b5f8feda..f04aa51c8 100644
--- a/tests/core/Statiq.Common.Tests/Statiq.Common.Tests.csproj
+++ b/tests/core/Statiq.Common.Tests/Statiq.Common.Tests.csproj
@@ -1,14 +1,28 @@
+
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1711
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062;CA1711
+
-
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/core/Statiq.Common.Tests/Util/RelativeUrlFixture.cs b/tests/core/Statiq.Common.Tests/Util/RelativeUrlFixture.cs
index 230156f41..10aba3914 100644
--- a/tests/core/Statiq.Common.Tests/Util/RelativeUrlFixture.cs
+++ b/tests/core/Statiq.Common.Tests/Util/RelativeUrlFixture.cs
@@ -27,7 +27,7 @@ public void ShouldParseRoot(string url, bool expected)
RelativeUrl relativeUrl = new RelativeUrl(url);
// Then
- Assert.AreEqual(expected, relativeUrl.HasRoot);
+ Assert.That(relativeUrl.HasRoot, Is.EqualTo(expected));
}
[TestCase(null, "")]
@@ -55,7 +55,7 @@ public void ShouldParseFragment(string url, string expected)
RelativeUrl relativeUrl = new RelativeUrl(url);
// Then
- Assert.AreEqual(expected, relativeUrl.Fragment);
+ Assert.That(relativeUrl.Fragment, Is.EqualTo(expected));
}
[TestCase(null, "")]
@@ -97,7 +97,7 @@ public void ShouldParseQuery(string url, string expected)
RelativeUrl relativeUrl = new RelativeUrl(url);
// Then
- Assert.AreEqual(expected, relativeUrl.Query);
+ Assert.That(relativeUrl.Query, Is.EqualTo(expected));
}
[TestCase(null, null)]
@@ -135,7 +135,7 @@ public void ShouldParsePath(string url, string expected)
RelativeUrl relativeUrl = new RelativeUrl(url);
// Then
- Assert.AreEqual(expected, (string)relativeUrl.Path);
+ Assert.That((string)relativeUrl.Path, Is.EqualTo(expected));
}
[TestCase("?", null, "?")]
@@ -155,7 +155,7 @@ public void ShouldCreateUrl(string url, string root, string expected)
RelativeUrl relativeUrl = new RelativeUrl(url, root);
// Then
- Assert.AreEqual(expected, relativeUrl.ToString());
+ Assert.That(relativeUrl.ToString(), Is.EqualTo(expected));
}
[Test]
@@ -165,7 +165,7 @@ public void ImplicitOperatorShouldMatchToString()
RelativeUrl relativeUrl = new RelativeUrl("~/foo?a=b#fragment", "root");
// Then
- Assert.AreEqual(relativeUrl.ToString(), (string)relativeUrl);
+ Assert.That((string)relativeUrl, Is.EqualTo(relativeUrl.ToString()));
}
}
}
diff --git a/tests/core/Statiq.Core.Tests/Execution/PipelineCollectionFixture.cs b/tests/core/Statiq.Core.Tests/Execution/PipelineCollectionFixture.cs
index 69d4744dc..500dabdb5 100644
--- a/tests/core/Statiq.Core.Tests/Execution/PipelineCollectionFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Execution/PipelineCollectionFixture.cs
@@ -56,7 +56,7 @@ public void ReturnsTrueForDifferentCase()
bool contains = pipelines.ContainsKey("test");
// Then
- Assert.IsTrue(contains);
+ Assert.That(contains, Is.True);
}
}
}
diff --git a/tests/core/Statiq.Core.Tests/IO/FileSystemFixture.cs b/tests/core/Statiq.Core.Tests/IO/FileSystemFixture.cs
index 277725786..bf30b025e 100644
--- a/tests/core/Statiq.Core.Tests/IO/FileSystemFixture.cs
+++ b/tests/core/Statiq.Core.Tests/IO/FileSystemFixture.cs
@@ -18,7 +18,7 @@ public void AddsDefaultInputPath()
FileSystem fileSystem = new FileSystem();
// Then
- CollectionAssert.AreEquivalent(new[] { "input" }, fileSystem.InputPaths.Select(x => x.FullPath));
+ Assert.That(fileSystem.InputPaths.Select(x => x.FullPath), Is.EquivalentTo(new[] { "input" }));
}
}
@@ -54,7 +54,7 @@ public void CanSet()
fileSystem.RootPath = "/foo/bar";
// Then
- Assert.AreEqual("/foo/bar", fileSystem.RootPath.FullPath);
+ Assert.That(fileSystem.RootPath.FullPath, Is.EqualTo("/foo/bar"));
}
}
@@ -80,7 +80,7 @@ public void CanSet()
fileSystem.OutputPath = "/foo/bar";
// Then
- Assert.AreEqual("/foo/bar", fileSystem.OutputPath.FullPath);
+ Assert.That(fileSystem.OutputPath.FullPath, Is.EqualTo("/foo/bar"));
}
}
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/CombineDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/CombineDocumentsFixture.cs
index 7eee661e7..80db55718 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/CombineDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/CombineDocumentsFixture.cs
@@ -26,12 +26,12 @@ public async Task AppendsContent()
IReadOnlyList results = await ExecuteAsync(new[] { a, b }, combine);
// Then
- CollectionAssert.AreEqual(
- new[] { "ab" },
+ Assert.That(
await results
.ToAsyncEnumerable()
.SelectAwait(async x => await x.GetContentStringAsync())
- .ToListAsync());
+ .ToListAsync(),
+ Is.EqualTo(new[] { "ab" }));
}
[Test]
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/ConcatDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/ConcatDocumentsFixture.cs
index 617113755..7badd2523 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/ConcatDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/ConcatDocumentsFixture.cs
@@ -36,15 +36,15 @@ public async Task ResultsInCorrectCountsWithInputDocumentsOnConcat()
IReadOnlyList results = await ExecuteAsync(a, new ConcatDocuments(b), c);
// Then
- Assert.AreEqual(1, a.ExecuteCount);
- Assert.AreEqual(1, b.ExecuteCount);
- Assert.AreEqual(1, c.ExecuteCount);
- Assert.AreEqual(1, a.InputCount);
- Assert.AreEqual(2, b.InputCount);
- Assert.AreEqual(8, c.InputCount);
- Assert.AreEqual(2, a.OutputCount);
- Assert.AreEqual(6, b.OutputCount);
- Assert.AreEqual(32, c.OutputCount);
+ Assert.That(a.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.ExecuteCount, Is.EqualTo(1));
+ Assert.That(c.ExecuteCount, Is.EqualTo(1));
+ Assert.That(a.InputCount, Is.EqualTo(1));
+ Assert.That(b.InputCount, Is.EqualTo(2));
+ Assert.That(c.InputCount, Is.EqualTo(8));
+ Assert.That(a.OutputCount, Is.EqualTo(2));
+ Assert.That(b.OutputCount, Is.EqualTo(6));
+ Assert.That(c.OutputCount, Is.EqualTo(32));
results.Count.ShouldBe(32);
}
}
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/ExecuteSwitchFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/ExecuteSwitchFixture.cs
index 0661fc11a..e2aed8071 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/ExecuteSwitchFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/ExecuteSwitchFixture.cs
@@ -24,10 +24,10 @@ public async Task SwitchResultsInCorrectCounts()
await ExecuteAsync(a, switchModule);
// Then
- Assert.AreEqual(1, a.ExecuteCount);
- Assert.AreEqual(1, b.ExecuteCount);
- Assert.AreEqual(1, c.ExecuteCount);
- Assert.AreEqual(1, d.ExecuteCount);
+ Assert.That(a.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.ExecuteCount, Is.EqualTo(1));
+ Assert.That(c.ExecuteCount, Is.EqualTo(1));
+ Assert.That(d.ExecuteCount, Is.EqualTo(1));
}
[Test]
@@ -47,11 +47,11 @@ public async Task SwitchNoCasesResultsInCorrectCounts()
await ExecuteAsync(a, switchModule, c);
// Then
- Assert.AreEqual(1, a.ExecuteCount);
- Assert.AreEqual(1, b.ExecuteCount);
- Assert.AreEqual(3, b.InputCount);
- Assert.AreEqual(3, b.OutputCount);
- Assert.AreEqual(3, c.InputCount);
+ Assert.That(a.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.InputCount, Is.EqualTo(3));
+ Assert.That(b.OutputCount, Is.EqualTo(3));
+ Assert.That(c.InputCount, Is.EqualTo(3));
}
[Test]
@@ -71,11 +71,11 @@ public async Task MissingDefaultResultsInCorrectCounts()
await ExecuteAsync(a, switchModule, c);
// Then
- Assert.AreEqual(1, a.ExecuteCount);
- Assert.AreEqual(1, b.ExecuteCount);
- Assert.AreEqual(1, b.InputCount);
- Assert.AreEqual(1, b.OutputCount);
- Assert.AreEqual(3, c.InputCount);
+ Assert.That(a.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.InputCount, Is.EqualTo(1));
+ Assert.That(b.OutputCount, Is.EqualTo(1));
+ Assert.That(c.InputCount, Is.EqualTo(3));
}
[Test]
@@ -95,11 +95,11 @@ public async Task ArrayInCaseResultsInCorrectCounts()
await ExecuteAsync(a, switchModule, c);
// Then
- Assert.AreEqual(1, a.ExecuteCount);
- Assert.AreEqual(1, b.ExecuteCount);
- Assert.AreEqual(2, b.InputCount);
- Assert.AreEqual(2, b.OutputCount);
- Assert.AreEqual(3, c.InputCount);
+ Assert.That(a.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.InputCount, Is.EqualTo(2));
+ Assert.That(b.OutputCount, Is.EqualTo(2));
+ Assert.That(c.InputCount, Is.EqualTo(3));
}
[Test]
@@ -118,7 +118,7 @@ public async Task OmittingCasesAndDefaultResultsInCorrectCounts()
await ExecuteAsync(a, switchModule, b);
// Then
- Assert.AreEqual(3, b.InputCount);
+ Assert.That(b.InputCount, Is.EqualTo(3));
}
}
}
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/GroupDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/GroupDocumentsFixture.cs
index 5fefb3d1f..50df049cc 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/GroupDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/GroupDocumentsFixture.cs
@@ -35,7 +35,7 @@ public async Task SetsCorrectMetadata()
IReadOnlyList results = await ExecuteAsync(count, groupByMany, gatherData);
// Then
- CollectionAssert.AreEquivalent(new[] { 0, 1, 2, 3 }, groupKey);
+ Assert.That(groupKey, Is.EquivalentTo(new[] { 0, 1, 2, 3 }));
}
[Test]
@@ -66,11 +66,11 @@ public async Task SetsDocumentsInMetadata()
IReadOnlyList results = await ExecuteAsync(count, groupByMany, orderBy, gatherData);
// Then
- Assert.AreEqual(4, content.Count);
- CollectionAssert.AreEquivalent(new[] { "3", "6" }, content[0]);
- CollectionAssert.AreEquivalent(new[] { "1", "4", "7" }, content[1]);
- CollectionAssert.AreEquivalent(new[] { "2", "5", "8" }, content[2]);
- CollectionAssert.AreEquivalent(new[] { "1", "2", "3", "4", "5", "6", "7", "8" }, content[3]);
+ Assert.That(content.Count, Is.EqualTo(4));
+ Assert.That(content[0], Is.EquivalentTo(new[] { "3", "6" }));
+ Assert.That(content[1], Is.EquivalentTo(new[] { "1", "4", "7" }));
+ Assert.That(content[2], Is.EquivalentTo(new[] { "2", "5", "8" }));
+ Assert.That(content[3], Is.EquivalentTo(new[] { "1", "2", "3", "4", "5", "6", "7", "8" }));
}
[Test]
@@ -96,7 +96,7 @@ public async Task GroupByMetadataKey()
IReadOnlyList results = await ExecuteAsync(count, meta, groupByMany, gatherData);
// Then
- CollectionAssert.AreEquivalent(new[] { 0, 1, 2, 3 }, groupKey);
+ Assert.That(groupKey, Is.EquivalentTo(new[] { 0, 1, 2, 3 }));
}
[Test]
@@ -127,7 +127,7 @@ public async Task GroupByMetadataKeyWithMissingMetadata()
IReadOnlyList results = await ExecuteAsync(count, meta, groupByMany, gatherData);
// Then
- CollectionAssert.AreEquivalent(new[] { 1, 2, 3 }, groupKey);
+ Assert.That(groupKey, Is.EquivalentTo(new[] { 1, 2, 3 }));
}
[Test]
@@ -157,7 +157,7 @@ public async Task DefaultComparerIsCaseSensitive()
IReadOnlyList results = await ExecuteAsync(meta, groupByMany, gatherData);
// Then
- CollectionAssert.AreEquivalent(new object[] { "A", "B", "b", "C", "c", 1, "1" }, groupKey);
+ Assert.That(groupKey, Is.EquivalentTo(new object[] { "A", "B", "b", "C", "c", 1, "1" }));
}
[Test]
@@ -187,7 +187,7 @@ public async Task CaseInsensitiveStringComparer()
IReadOnlyList results = await ExecuteAsync(meta, groupByMany, gatherData);
// Then
- CollectionAssert.AreEquivalent(new object[] { "A", "b", "C", 1 }, groupKey);
+ Assert.That(groupKey, Is.EquivalentTo(new object[] { "A", "b", "C", 1 }));
}
}
}
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/MergeDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/MergeDocumentsFixture.cs
index 1ecf44430..e0c9c7a49 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/MergeDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/MergeDocumentsFixture.cs
@@ -35,7 +35,7 @@ public async Task ReplacesContent()
new SetMetadata("Content", Config.FromDocument(async doc => await doc.GetContentStringAsync())));
// Then
- CollectionAssert.AreEqual(new[] { "1121" }, results.Select(x => x["Content"]));
+ Assert.That(results.Select(x => x["Content"]), Is.EqualTo(new[] { "1121" }));
}
[Test]
@@ -60,7 +60,7 @@ public async Task ReverseReplacesContent()
new SetMetadata("Content", Config.FromDocument(async doc => await doc.GetContentStringAsync())));
// Then
- CollectionAssert.AreEqual(new[] { "11" }, results.Select(x => x["Content"]));
+ Assert.That(results.Select(x => x["Content"]), Is.EqualTo(new[] { "11" }));
}
[Test]
@@ -82,8 +82,8 @@ public async Task CombinesMetadata()
IReadOnlyList results = await ExecuteAsync(a, new MergeDocuments(b));
// Then
- CollectionAssert.AreEqual(new[] { 11 }, results.Select(x => x["A"]));
- CollectionAssert.AreEqual(new[] { 21 }, results.Select(x => x["B"]));
+ Assert.That(results.Select(x => x["A"]), Is.EqualTo(new[] { 11 }));
+ Assert.That(results.Select(x => x["B"]), Is.EqualTo(new[] { 21 }));
}
[Test]
@@ -105,7 +105,7 @@ public async Task CombinesAndOverwritesMetadata()
IReadOnlyList results = await ExecuteAsync(a, new MergeDocuments(b));
// Then
- CollectionAssert.AreEqual(new[] { 21 }, results.Select(x => x["A"]));
+ Assert.That(results.Select(x => x["A"]), Is.EqualTo(new[] { 21 }));
}
[Test]
@@ -127,10 +127,10 @@ public async Task SingleInputSingleResult()
IReadOnlyList results = await ExecuteAsync(a, new MergeDocuments(b));
// Then
- Assert.AreEqual(1, a.OutputCount);
- Assert.AreEqual(1, b.OutputCount);
- CollectionAssert.AreEqual(new[] { 11 }, results.Select(x => x["A"]));
- CollectionAssert.AreEqual(new[] { 21 }, results.Select(x => x["B"]));
+ Assert.That(a.OutputCount, Is.EqualTo(1));
+ Assert.That(b.OutputCount, Is.EqualTo(1));
+ Assert.That(results.Select(x => x["A"]), Is.EqualTo(new[] { 11 }));
+ Assert.That(results.Select(x => x["B"]), Is.EqualTo(new[] { 21 }));
}
[Test]
@@ -153,10 +153,10 @@ public async Task SingleInputMultipleResults()
IReadOnlyList results = await ExecuteAsync(a, new MergeDocuments(b));
// Then
- Assert.AreEqual(1, a.OutputCount);
- Assert.AreEqual(2, b.OutputCount);
- CollectionAssert.AreEqual(new[] { 11, 11 }, results.Select(x => x["A"]));
- CollectionAssert.AreEqual(new[] { 21, 22 }, results.Select(x => x["B"]));
+ Assert.That(a.OutputCount, Is.EqualTo(1));
+ Assert.That(b.OutputCount, Is.EqualTo(2));
+ Assert.That(results.Select(x => x["A"]), Is.EqualTo(new[] { 11, 11 }));
+ Assert.That(results.Select(x => x["B"]), Is.EqualTo(new[] { 21, 22 }));
}
[Test]
@@ -236,15 +236,15 @@ public async Task ResultsInCorrectCountsWithInputDocuments()
IReadOnlyList results = await ExecuteAsync(a, new MergeDocuments(b), c);
// Then
- Assert.AreEqual(1, a.ExecuteCount);
- Assert.AreEqual(1, b.ExecuteCount);
- Assert.AreEqual(1, c.ExecuteCount);
- Assert.AreEqual(1, a.InputCount);
- Assert.AreEqual(2, b.InputCount);
- Assert.AreEqual(12, c.InputCount);
- Assert.AreEqual(2, a.OutputCount);
- Assert.AreEqual(6, b.OutputCount);
- Assert.AreEqual(48, c.OutputCount);
+ Assert.That(a.ExecuteCount, Is.EqualTo(1));
+ Assert.That(b.ExecuteCount, Is.EqualTo(1));
+ Assert.That(c.ExecuteCount, Is.EqualTo(1));
+ Assert.That(a.InputCount, Is.EqualTo(1));
+ Assert.That(b.InputCount, Is.EqualTo(2));
+ Assert.That(c.InputCount, Is.EqualTo(12));
+ Assert.That(a.OutputCount, Is.EqualTo(2));
+ Assert.That(b.OutputCount, Is.EqualTo(6));
+ Assert.That(c.OutputCount, Is.EqualTo(48));
results.Count.ShouldBe(48);
}
}
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/OrderDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/OrderDocumentsFixture.cs
index bf8f686c9..5200c770d 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/OrderDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/OrderDocumentsFixture.cs
@@ -107,8 +107,8 @@ public async Task OrdersThenByInAscendingOrder()
await ExecuteAsync(count, count2, orderBy, gatherData);
// Then
- Assert.AreEqual(10, content.Count); // (4+1) * (21+1)
- CollectionAssert.AreEqual(new[] { "11", "12", "23", "24", "35", "36", "47", "48", "59", "510" }, content);
+ Assert.That(content.Count, Is.EqualTo(10)); // (4+1) * (21+1)
+ Assert.That(content, Is.EqualTo(new[] { "11", "12", "23", "24", "35", "36", "47", "48", "59", "510" }));
}
[Test]
@@ -139,8 +139,8 @@ public async Task OrdersThenByInDescendingOrder()
await ExecuteAsync(count, count2, orderBy, gatherData);
// Then
- Assert.AreEqual(10, content.Count); // (4+1) * (21+1)
- CollectionAssert.AreEqual(new[] { "12", "11", "24", "23", "36", "35", "48", "47", "510", "59" }, content);
+ Assert.That(content.Count, Is.EqualTo(10)); // (4+1) * (21+1)
+ Assert.That(content, Is.EqualTo(new[] { "12", "11", "24", "23", "36", "35", "48", "47", "510", "59" }));
}
[Test]
@@ -172,8 +172,8 @@ public async Task OrdersDescendingThenByInDescendingOrder()
await ExecuteAsync(count, count2, orderBy, gatherData);
// Then
- Assert.AreEqual(10, content.Count); // (4+1) * (21+1)
- CollectionAssert.AreEqual(new[] { "510", "59", "48", "47", "36", "35", "24", "23", "12", "11" }, content);
+ Assert.That(content.Count, Is.EqualTo(10)); // (4+1) * (21+1)
+ Assert.That(content, Is.EqualTo(new[] { "510", "59", "48", "47", "36", "35", "24", "23", "12", "11" }));
}
[Test]
@@ -204,8 +204,8 @@ public async Task OrdersDescendingThenByInAscendingOrder()
await ExecuteAsync(count, count2, orderBy, gatherData);
// Then
- Assert.AreEqual(10, content.Count); // (4+1) * (21+1)
- CollectionAssert.AreEqual(new[] { "59", "510", "47", "48", "35", "36", "23", "24", "11", "12" }, content);
+ Assert.That(content.Count, Is.EqualTo(10)); // (4+1) * (21+1)
+ Assert.That(content, Is.EqualTo(new[] { "59", "510", "47", "48", "35", "36", "23", "24", "11", "12" }));
}
[Test]
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/PaginateDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/PaginateDocumentsFixture.cs
index fb51028ac..94dba5898 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/PaginateDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/PaginateDocumentsFixture.cs
@@ -40,10 +40,10 @@ public async Task PaginateSetsDocumentsInMetadata()
await ExecuteAsync(count, paginate, gatherData);
// Then
- Assert.AreEqual(3, content.Count);
- CollectionAssert.AreEqual(new[] { "1", "2", "3" }, content[0]);
- CollectionAssert.AreEqual(new[] { "4", "5", "6" }, content[1]);
- CollectionAssert.AreEqual(new[] { "7", "8" }, content[2]);
+ Assert.That(content.Count, Is.EqualTo(3));
+ Assert.That(content[0], Is.EqualTo(new[] { "1", "2", "3" }));
+ Assert.That(content[1], Is.EqualTo(new[] { "4", "5", "6" }));
+ Assert.That(content[2], Is.EqualTo(new[] { "7", "8" }));
}
[Test]
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/ProcessSidecarFileFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/ProcessSidecarFileFixture.cs
index 26dd04ade..68b29045b 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/ProcessSidecarFileFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/ProcessSidecarFileFixture.cs
@@ -36,8 +36,8 @@ public async Task LoadsSidecarFile()
IReadOnlyList documents = await ExecuteAsync(inputs, context, sidecar);
// Then
- Assert.AreEqual("data: a1", lodedSidecarContent);
- Assert.AreEqual("File a1", documents.Single().Content);
+ Assert.That(lodedSidecarContent, Is.EqualTo("data: a1"));
+ Assert.That(documents.Single().Content, Is.EqualTo("File a1"));
}
[Test]
@@ -63,8 +63,8 @@ public async Task LoadsCustomSidecarFile()
IReadOnlyList documents = await ExecuteAsync(inputs, context, sidecar);
// Then
- Assert.AreEqual("data: other", lodedSidecarContent);
- Assert.AreEqual("File a1", documents.Single().Content);
+ Assert.That(lodedSidecarContent, Is.EqualTo("data: other"));
+ Assert.That(documents.Single().Content, Is.EqualTo("File a1"));
}
[Test]
@@ -90,8 +90,8 @@ public async Task ReturnsOriginalDocumentForMissingSidecarFile()
IReadOnlyList documents = await ExecuteAsync(inputs, context, sidecar);
// Then
- Assert.IsFalse(executedSidecarModules);
- Assert.AreEqual(inputs.First(), documents.First());
+ Assert.That(executedSidecarModules, Is.False);
+ Assert.That(documents.First(), Is.EqualTo(inputs.First()));
}
private TestDocument GetDocument(string source, string content) =>
diff --git a/tests/core/Statiq.Core.Tests/Modules/Control/ReplaceDocumentsFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Control/ReplaceDocumentsFixture.cs
index b3f746e5d..8a66b0aa5 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Control/ReplaceDocumentsFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Control/ReplaceDocumentsFixture.cs
@@ -36,8 +36,8 @@ public async Task PipelineReturnsCorrectDocuments()
await engine.ExecuteAsync(cancellationTokenSource.Token);
// Then
- Assert.AreEqual(4, content.Count);
- CollectionAssert.AreEquivalent(new[] { "A", "B", "C", "D" }, content);
+ Assert.That(content.Count, Is.EqualTo(4));
+ Assert.That(content, Is.EquivalentTo(new[] { "A", "B", "C", "D" }));
}
[Test]
@@ -63,8 +63,8 @@ public async Task EmptyConstructorWithSpecifiedPipelinesReturnsCorrectDocuments(
await engine.ExecuteAsync(cancellationTokenSource.Token);
// Then
- Assert.AreEqual(6, content.Count);
- CollectionAssert.AreEquivalent(new[] { "A", "B", "C", "D", "G", "H" }, content);
+ Assert.That(content.Count, Is.EqualTo(6));
+ Assert.That(content, Is.EquivalentTo(new[] { "A", "B", "C", "D", "G", "H" }));
}
[Test]
@@ -90,8 +90,8 @@ public async Task SpecifiedPipelineDocumentsAreReturnedInCorrectOrder()
await engine.ExecuteAsync(cancellationTokenSource.Token);
// Then
- Assert.AreEqual(6, content.Count);
- CollectionAssert.AreEquivalent(new[] { "G", "H", "A", "B", "C", "D" }, content);
+ Assert.That(content.Count, Is.EqualTo(6));
+ Assert.That(content, Is.EquivalentTo(new[] { "G", "H", "A", "B", "C", "D" }));
}
}
}
diff --git a/tests/core/Statiq.Core.Tests/Modules/Extensibility/ExecuteConfigFixture.cs b/tests/core/Statiq.Core.Tests/Modules/Extensibility/ExecuteConfigFixture.cs
index 6480415cc..a9ecb5fd2 100644
--- a/tests/core/Statiq.Core.Tests/Modules/Extensibility/ExecuteConfigFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/Extensibility/ExecuteConfigFixture.cs
@@ -40,7 +40,7 @@ public async Task ContextConfigReturnsInputsForNullResult()
IReadOnlyList outputs = await ExecuteAsync(inputs, execute);
// Then
- CollectionAssert.AreEqual(inputs, outputs);
+ Assert.That(outputs, Is.EqualTo(inputs));
}
[Test]
@@ -156,7 +156,7 @@ public async Task DocumentConfigReturnsInputsForNullResult()
IReadOnlyList outputs = await ExecuteAsync(inputs, execute);
// Then
- CollectionAssert.AreEqual(inputs, outputs);
+ Assert.That(outputs, Is.EqualTo(inputs));
}
[Test]
@@ -174,7 +174,7 @@ public async Task DocumentConfigReturnsDocumentForSingleResultDocument()
IReadOnlyList result = await ExecuteAsync(count, execute);
// Then
- CollectionAssert.AreEquivalent(document, result.Single());
+ Assert.That(result.Single(), Is.EqualTo(document));
}
[Test]
diff --git a/tests/core/Statiq.Core.Tests/Modules/IO/CopyFilesFixture.cs b/tests/core/Statiq.Core.Tests/Modules/IO/CopyFilesFixture.cs
index f8b900326..5f947eca4 100644
--- a/tests/core/Statiq.Core.Tests/Modules/IO/CopyFilesFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/IO/CopyFilesFixture.cs
@@ -41,12 +41,12 @@ public async Task RecursivePatternCopiesFiles()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
}
[Test]
@@ -60,12 +60,12 @@ public async Task CopyFilesInTopDirectoryOnly()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
}
[Test]
@@ -79,12 +79,12 @@ public async Task CopyFilesInSubfolderOnly()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
}
[Test]
@@ -98,13 +98,13 @@ public async Task DoesNotCopyFilesAboveInputPath()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-above-input.txt").Exists);
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("test-above-input.txt").Exists, Is.False);
}
[Test]
@@ -118,13 +118,13 @@ public async Task CopyFilesAboveInputPathWithOthers()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-above-input.txt").Exists); // Files outside an input path will not be copied
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("test-above-input.txt").Exists, Is.False); // Files outside an input path will not be copied
}
[Test]
@@ -138,12 +138,12 @@ public async Task CopyFolderFromAbsolutePath()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsTrue(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.True);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
}
[Test]
@@ -157,12 +157,12 @@ public async Task CopyNonExistingFolder()
await ExecuteAsync(context, copyFiles);
// Then
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-a.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("test-b.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputDirectory("Subfolder").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("markdown-x.md").Exists);
- Assert.IsFalse(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists);
+ Assert.That(context.FileSystem.GetOutputFile("test-a.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("test-b.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/test-c.txt").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputDirectory("Subfolder").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("markdown-x.md").Exists, Is.False);
+ Assert.That(context.FileSystem.GetOutputFile("Subfolder/markdown-y.md").Exists, Is.False);
}
public async Task ShouldSetSourceAndDestination()
diff --git a/tests/core/Statiq.Core.Tests/Modules/IO/ReadWebFixture.cs b/tests/core/Statiq.Core.Tests/Modules/IO/ReadWebFixture.cs
index cc7999f91..7e60b3a2f 100644
--- a/tests/core/Statiq.Core.Tests/Modules/IO/ReadWebFixture.cs
+++ b/tests/core/Statiq.Core.Tests/Modules/IO/ReadWebFixture.cs
@@ -41,13 +41,13 @@ public async Task SingleHtmlDownloadGetStream()
// Then
Dictionary headers = result[Keys.SourceHeaders] as Dictionary;
- Assert.IsNotNull(headers, "Header cannot be null");
- Assert.IsTrue(headers.Count > 0, "Headers must contain contents");
+ Assert.That(headers, Is.Not.Null, "Header cannot be null");
+ Assert.That(headers.Count, Is.GreaterThan(0), "Headers must contain contents");
foreach (KeyValuePair h in headers)
{
- Assert.IsNotEmpty(h.Key, "Header key cannot be empty");
- Assert.IsNotEmpty(h.Value, "Header value cannot be empty");
+ Assert.That(h.Key, Is.Not.Empty, "Header key cannot be empty");
+ Assert.That(h.Value, Is.Not.Empty, "Header value cannot be empty");
}
result.Content.ShouldNotBeEmpty();
@@ -81,13 +81,13 @@ public async Task MultipleHtmlDownload()
{
Dictionary headers = result[Keys.SourceHeaders] as Dictionary;
- Assert.IsNotNull(headers, "Header cannot be null");
- Assert.IsTrue(headers.Count > 0, "Headers must contain contents");
+ Assert.That(headers, Is.Not.Null, "Header cannot be null");
+ Assert.That(headers.Count, Is.GreaterThan(0), "Headers must contain contents");
foreach (KeyValuePair h in headers)
{
- Assert.IsNotEmpty(h.Key, "Header key cannot be empty");
- Assert.IsNotEmpty(h.Value, "Header value cannot be empty");
+ Assert.That(h.Key, Is.Not.Empty, "Header key cannot be empty");
+ Assert.That(h.Value, Is.Not.Empty, "Header value cannot be empty");
}
result.Content.ShouldNotBeEmpty();
diff --git a/tests/core/Statiq.Core.Tests/Statiq.Core.Tests.csproj b/tests/core/Statiq.Core.Tests/Statiq.Core.Tests.csproj
index 17cb182c3..d2e2e5379 100644
--- a/tests/core/Statiq.Core.Tests/Statiq.Core.Tests.csproj
+++ b/tests/core/Statiq.Core.Tests/Statiq.Core.Tests.csproj
@@ -1,10 +1,18 @@
+
+ net8.0
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/core/TestConsoleApp/TestConsoleApp.csproj b/tests/core/TestConsoleApp/TestConsoleApp.csproj
index c73e0d169..ffc1a7757 100644
--- a/tests/core/TestConsoleApp/TestConsoleApp.csproj
+++ b/tests/core/TestConsoleApp/TestConsoleApp.csproj
@@ -1,8 +1,6 @@
-
Exe
- netcoreapp3.1
+ net8.0
-
-
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.CodeAnalysis.Tests/AnalyzeCSharpTypesFixture.cs b/tests/extensions/Statiq.CodeAnalysis.Tests/AnalyzeCSharpTypesFixture.cs
index bf7654848..f65342313 100644
--- a/tests/extensions/Statiq.CodeAnalysis.Tests/AnalyzeCSharpTypesFixture.cs
+++ b/tests/extensions/Statiq.CodeAnalysis.Tests/AnalyzeCSharpTypesFixture.cs
@@ -435,7 +435,7 @@ enum Yellow
// Then
results.Single(x => x["Name"].Equals("Green"))["SpecificKind"].ShouldBe("Class");
results.Single(x => x["Name"].Equals("Blue"))["SpecificKind"].ShouldBe("Class");
- results.Single(x => x["Name"].Equals("Red"))["SpecificKind"].ShouldBe("Structure");
+ results.Single(x => x["Name"].Equals("Red"))["SpecificKind"].ShouldBe("Struct");
results.Single(x => x["Name"].Equals("Yellow"))["SpecificKind"].ShouldBe("Enum");
}
diff --git a/tests/extensions/Statiq.CodeAnalysis.Tests/Statiq.CodeAnalysis.Tests.csproj b/tests/extensions/Statiq.CodeAnalysis.Tests/Statiq.CodeAnalysis.Tests.csproj
index 869e9379d..26898e104 100644
--- a/tests/extensions/Statiq.CodeAnalysis.Tests/Statiq.CodeAnalysis.Tests.csproj
+++ b/tests/extensions/Statiq.CodeAnalysis.Tests/Statiq.CodeAnalysis.Tests.csproj
@@ -1,4 +1,7 @@
+
+ net8.0
+
@@ -10,4 +13,9 @@
Designer
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Feeds.Tests/Statiq.Feeds.Tests.csproj b/tests/extensions/Statiq.Feeds.Tests/Statiq.Feeds.Tests.csproj
index ea7c86e4e..40d772b0c 100644
--- a/tests/extensions/Statiq.Feeds.Tests/Statiq.Feeds.Tests.csproj
+++ b/tests/extensions/Statiq.Feeds.Tests/Statiq.Feeds.Tests.csproj
@@ -1,7 +1,15 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Handlebars.Tests/RenderHandlebarsFixture.cs b/tests/extensions/Statiq.Handlebars.Tests/RenderHandlebarsFixture.cs
index fe26ae28e..80eb1f9df 100644
--- a/tests/extensions/Statiq.Handlebars.Tests/RenderHandlebarsFixture.cs
+++ b/tests/extensions/Statiq.Handlebars.Tests/RenderHandlebarsFixture.cs
@@ -187,7 +187,11 @@ public async Task RendersHandlebarsWithHelper()
.WithHelper(
"link_to",
Config.FromValue((writer, context, _) =>
- HandlebarsExtensions.WriteSafeString(writer, "" + context.text + "")));
+ {
+ string url = context.GetValue("url");
+ string text = context.GetValue("text");
+ HandlebarsExtensions.WriteSafeString(writer, $"{text}");
+ }));
// When
TestDocument result = await ExecuteAsync(document, handlebars).SingleAsync();
@@ -201,7 +205,7 @@ public async Task RendersHandlebarsWithBlockHelper()
{
// Given
const string input = @"{{#each animals}}
-The animal, {{name}}, {{StringEqualityBlockHelper type 'dog'}}is a dog{{else}}is not a dog{{/StringEqualityBlockHelper}}.
+The animal, {{name}}, {{#StringEqualityBlockHelper type 'dog'}}is a dog{{else}}is not a dog{{/StringEqualityBlockHelper}}.
{{/each}}";
const string output = @"The animal, Fluffy, is not a dog.
The animal, Fido, is a dog.
@@ -302,7 +306,11 @@ public async Task RendersHandlebarsWithHelperUsingConfigure()
RenderHandlebars handlebars = new RenderHandlebars()
.Configure((_, __, x) => x.RegisterHelper("link_to", (writer, context, _) =>
- HandlebarsExtensions.WriteSafeString(writer, "" + context.text + "")));
+ {
+ string url = context.GetValue("url");
+ string text = context.GetValue("text");
+ HandlebarsExtensions.WriteSafeString(writer, $"{text}");
+ }));
// When
TestDocument result = await ExecuteAsync(document, handlebars).SingleAsync();
@@ -316,7 +324,7 @@ public async Task RendersHandlebarsWithBlockHelperUsingConfigure()
{
// Given
const string input = @"{{#each animals}}
-The animal, {{name}}, {{StringEqualityBlockHelper type 'dog'}}is a dog{{else}}is not a dog{{/StringEqualityBlockHelper}}.
+The animal, {{name}}, {{#StringEqualityBlockHelper type 'dog'}}is a dog{{else}}is not a dog{{/StringEqualityBlockHelper}}.
{{/each}}";
const string output = @"The animal, Fluffy, is not a dog.
The animal, Fido, is a dog.
@@ -338,22 +346,22 @@ public async Task RendersHandlebarsWithBlockHelperUsingConfigure()
RenderHandlebars handlebars = new RenderHandlebars()
.Configure((_, __, x) => x.RegisterHelper("StringEqualityBlockHelper", (writer, options, __, arguments) =>
+ {
+ if (arguments.Length != 2)
{
- if (arguments.Length != 2)
- {
- throw new HandlebarsException("{{StringEqualityBlockHelper}} helper must have exactly two argument");
- }
- string left = arguments[0] as string;
- string right = arguments[1] as string;
- if (left == right)
- {
- options.Template(writer, null);
- }
- else
- {
- options.Inverse(writer, null);
- }
- }));
+ throw new HandlebarsException("{{StringEqualityBlockHelper}} helper must have exactly two argument");
+ }
+ string left = arguments[0] as string;
+ string right = arguments[1] as string;
+ if (left == right)
+ {
+ options.Template(writer, null);
+ }
+ else
+ {
+ options.Inverse(writer, null);
+ }
+ }));
// When
TestDocument result = await ExecuteAsync(document, handlebars).SingleAsync();
diff --git a/tests/extensions/Statiq.Handlebars.Tests/Statiq.Handlebars.Tests.csproj b/tests/extensions/Statiq.Handlebars.Tests/Statiq.Handlebars.Tests.csproj
index 72f49c549..7addbabe2 100644
--- a/tests/extensions/Statiq.Handlebars.Tests/Statiq.Handlebars.Tests.csproj
+++ b/tests/extensions/Statiq.Handlebars.Tests/Statiq.Handlebars.Tests.csproj
@@ -1,7 +1,15 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Highlight.Tests/Statiq.Highlight.Tests.csproj b/tests/extensions/Statiq.Highlight.Tests/Statiq.Highlight.Tests.csproj
index eca7ba300..df16b832b 100644
--- a/tests/extensions/Statiq.Highlight.Tests/Statiq.Highlight.Tests.csproj
+++ b/tests/extensions/Statiq.Highlight.Tests/Statiq.Highlight.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Images.Tests/Statiq.Images.Tests.csproj b/tests/extensions/Statiq.Images.Tests/Statiq.Images.Tests.csproj
index 82937c608..daeec67c3 100644
--- a/tests/extensions/Statiq.Images.Tests/Statiq.Images.Tests.csproj
+++ b/tests/extensions/Statiq.Images.Tests/Statiq.Images.Tests.csproj
@@ -1,4 +1,7 @@
+
+ net8.0
+
@@ -10,4 +13,9 @@
Always
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Less.Tests/Statiq.Less.Tests.csproj b/tests/extensions/Statiq.Less.Tests/Statiq.Less.Tests.csproj
index 1b50bc5f1..ab3bb70e0 100644
--- a/tests/extensions/Statiq.Less.Tests/Statiq.Less.Tests.csproj
+++ b/tests/extensions/Statiq.Less.Tests/Statiq.Less.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Lunr.Tests/GenerateLunrIndexFixture.cs b/tests/extensions/Statiq.Lunr.Tests/GenerateLunrIndexFixture.cs
index 974cf9453..56a183899 100644
--- a/tests/extensions/Statiq.Lunr.Tests/GenerateLunrIndexFixture.cs
+++ b/tests/extensions/Statiq.Lunr.Tests/GenerateLunrIndexFixture.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
+using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -14,6 +15,14 @@ namespace Statiq.Lunr.Tests
[TestFixture]
public class GenerateLunrIndexFixture : BaseFixture
{
+ [SetUp]
+ public void SetUp()
+ {
+ // Set the culture to en-US for the tests, otherwise tests with decimals fail on machines with , as decimal seperator
+ CultureInfo.CurrentCulture = new CultureInfo("en-US");
+ CultureInfo.CurrentUICulture = new CultureInfo("en-US");
+ }
+
public class ExecuteTests : GenerateLunrIndexFixture
{
[Test]
@@ -541,7 +550,7 @@ public async Task ConvertsSearchableField(object value, string expected)
// Then
TestDocument indexDocument = results.ShouldHaveSingleWithDestination(GenerateLunrIndex.DefaultScriptPath.ChangeExtension(".index.json"));
- indexDocument.Content.ShouldContain(expected);
+ indexDocument.Content.ShouldContainWithoutWhitespace(expected); // ShouldContain is clipped to first 100 chars, but occurrence is beyond. This method is not clipped; Workaround
}
[Test]
diff --git a/tests/extensions/Statiq.Lunr.Tests/Statiq.Lunr.Tests.csproj b/tests/extensions/Statiq.Lunr.Tests/Statiq.Lunr.Tests.csproj
index b1463db2d..9a087c9d9 100644
--- a/tests/extensions/Statiq.Lunr.Tests/Statiq.Lunr.Tests.csproj
+++ b/tests/extensions/Statiq.Lunr.Tests/Statiq.Lunr.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Markdown.Tests/Statiq.Markdown.Tests.csproj b/tests/extensions/Statiq.Markdown.Tests/Statiq.Markdown.Tests.csproj
index 5e61a648c..9b3ce7108 100644
--- a/tests/extensions/Statiq.Markdown.Tests/Statiq.Markdown.Tests.csproj
+++ b/tests/extensions/Statiq.Markdown.Tests/Statiq.Markdown.Tests.csproj
@@ -1,7 +1,21 @@
+
+ net8.0
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+ NU1901;NU1902;NU1903;NU1904;CA1724;CA1062
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Minification.Tests/Statiq.Minification.Tests.csproj b/tests/extensions/Statiq.Minification.Tests/Statiq.Minification.Tests.csproj
index 5df76cde0..05cc69e70 100644
--- a/tests/extensions/Statiq.Minification.Tests/Statiq.Minification.Tests.csproj
+++ b/tests/extensions/Statiq.Minification.Tests/Statiq.Minification.Tests.csproj
@@ -1,7 +1,15 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Razor.Tests/EmailTagHelper.cs b/tests/extensions/Statiq.Razor.Tests/EmailTagHelper.cs
index fea22c2eb..26e1c39d2 100644
--- a/tests/extensions/Statiq.Razor.Tests/EmailTagHelper.cs
+++ b/tests/extensions/Statiq.Razor.Tests/EmailTagHelper.cs
@@ -1,4 +1,5 @@
-using System.Threading.Tasks;
+using System;
+using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Statiq.Razor.Tests
@@ -7,6 +8,8 @@ public class EmailTagHelper : TagHelper
{
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
{
+ ArgumentNullException.ThrowIfNull(output);
+
output.TagName = "a"; // Replaces with tag
string address = (await output.GetChildContentAsync()).GetContent() + "@foo.com";
output.Attributes.SetAttribute("href", "mailto:" + address);
diff --git a/tests/extensions/Statiq.Razor.Tests/Statiq.Razor.Tests.csproj b/tests/extensions/Statiq.Razor.Tests/Statiq.Razor.Tests.csproj
index 7a32a9ec6..4aa335cbd 100644
--- a/tests/extensions/Statiq.Razor.Tests/Statiq.Razor.Tests.csproj
+++ b/tests/extensions/Statiq.Razor.Tests/Statiq.Razor.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Sass.Tests/Statiq.Sass.Tests.csproj b/tests/extensions/Statiq.Sass.Tests/Statiq.Sass.Tests.csproj
index 955c3a2c3..73d8459d2 100644
--- a/tests/extensions/Statiq.Sass.Tests/Statiq.Sass.Tests.csproj
+++ b/tests/extensions/Statiq.Sass.Tests/Statiq.Sass.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Scriban.Tests/Statiq.Scriban.Tests.csproj b/tests/extensions/Statiq.Scriban.Tests/Statiq.Scriban.Tests.csproj
index d091c8884..7e49ff797 100644
--- a/tests/extensions/Statiq.Scriban.Tests/Statiq.Scriban.Tests.csproj
+++ b/tests/extensions/Statiq.Scriban.Tests/Statiq.Scriban.Tests.csproj
@@ -1,7 +1,15 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Tables.Tests/Statiq.Tables.Tests.csproj b/tests/extensions/Statiq.Tables.Tests/Statiq.Tables.Tests.csproj
index 012b2c5c0..b6a980d22 100644
--- a/tests/extensions/Statiq.Tables.Tests/Statiq.Tables.Tests.csproj
+++ b/tests/extensions/Statiq.Tables.Tests/Statiq.Tables.Tests.csproj
@@ -1,4 +1,7 @@
+
+ net8.0
+
@@ -13,4 +16,9 @@
Always
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Xmp.Tests/Statiq.Xmp.Tests.csproj b/tests/extensions/Statiq.Xmp.Tests/Statiq.Xmp.Tests.csproj
index eeb3173f3..e433fd624 100644
--- a/tests/extensions/Statiq.Xmp.Tests/Statiq.Xmp.Tests.csproj
+++ b/tests/extensions/Statiq.Xmp.Tests/Statiq.Xmp.Tests.csproj
@@ -1,4 +1,7 @@
+
+ net8.0
+
@@ -18,4 +21,9 @@
Always
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.Yaml.Tests/Statiq.Yaml.Tests.csproj b/tests/extensions/Statiq.Yaml.Tests/Statiq.Yaml.Tests.csproj
index 73656e00a..5d13f01b3 100644
--- a/tests/extensions/Statiq.Yaml.Tests/Statiq.Yaml.Tests.csproj
+++ b/tests/extensions/Statiq.Yaml.Tests/Statiq.Yaml.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/extensions/Statiq.YouTube.Tests/Statiq.YouTube.Tests.csproj b/tests/extensions/Statiq.YouTube.Tests/Statiq.YouTube.Tests.csproj
index 138362753..eba1b5f5d 100644
--- a/tests/extensions/Statiq.YouTube.Tests/Statiq.YouTube.Tests.csproj
+++ b/tests/extensions/Statiq.YouTube.Tests/Statiq.YouTube.Tests.csproj
@@ -1,8 +1,16 @@
+
+ net8.0
+
+
+
+
+
+
\ No newline at end of file