Skip to content

Commit 2a22709

Browse files
authored
Merge pull request #178 from BryanWilhite/dev/version-8.0.0
Dev/version 8.0.0
2 parents 66a8b5a + 4c70b50 commit 2a22709

File tree

1,887 files changed

+205204
-549600
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,887 files changed

+205204
-549600
lines changed

.vscode/tasks.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,19 @@
182182
"command": "dotnet",
183183
"type": "shell",
184184
"args": [
185-
"${workspaceFolder}/Statiq.Docs.Shell/bin/Release/net6.0/Statiq.Docs.Shell.dll",
185+
"${workspaceFolder}/Statiq.Docs.Shell/bin/Release/net8.0/Statiq.Docs.Shell.dll",
186186
"--configuration",
187187
"Release",
188188
"--",
189189
"--root",
190-
"${workspaceFolder}/Statiq.Docs.Shell/bin/Release/net6.0/",
190+
"${workspaceFolder}/Statiq.Docs.Shell/bin/Release/net8.0/",
191191
"--log-level",
192192
"Information",
193193
"--log-file",
194194
"${workspaceFolder}/Statiq.Docs.Shell/statiq-"
195195
],
196196
"options": {
197-
"cwd": "${workspaceRoot}/Statiq.Docs.Shell/bin/Release/net6.0/"
197+
"cwd": "${workspaceRoot}/Statiq.Docs.Shell/bin/Release/net8.0/"
198198
},
199199
"problemMatcher": "$msCompile"
200200
},
@@ -207,10 +207,10 @@
207207
"add",
208208
"--force",
209209
"git@github.com:statiqdev/Docable.git",
210-
"${workspaceFolder}/Statiq.Docs.Shell/bin/Release/net6.0/theme/"
210+
"${workspaceFolder}/Statiq.Docs.Shell/bin/Release/net8.0/theme/"
211211
],
212212
"options": {
213-
"cwd": "${workspaceRoot}/Statiq.Docs.Shell/bin/Release/net6.0/"
213+
"cwd": "${workspaceRoot}/Statiq.Docs.Shell/bin/Release/net8.0/"
214214
},
215215
"problemMatcher": "$msCompile"
216216
},

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Bryan Wilhite
3+
Copyright (c) 2025 Bryan Wilhite
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Build Status](https://songhay.visualstudio.com/SonghaySystem/_apis/build/status/songhay-core-yaml-build?branchName=master)](https://songhay.visualstudio.com/SonghaySystem/_build/latest?definitionId=16&branchName=master)
44

5-
The _Core_ code to install as [a NuGet package](https://www.nuget.org/packages/SonghayCore/) for all of my studio Solutions. Anyone who may be reading this 👀 is free to do the same. This package is based on [a project file](https://github.com/BryanWilhite/SonghayCore/blob/master/SonghayCore/SonghayCore.csproj) that supports [multi-targeting](http://gigi.nullneuron.net/gigilabs/multi-targeting-net-standard-class-libraries/), declaring support for `net6.0`.
5+
The _Core_ code to install as [a NuGet package](https://www.nuget.org/packages/SonghayCore/) for all of my studio Solutions. Anyone who may be reading this 👀 is free to do the same. This package is based on [a project file](https://github.com/BryanWilhite/SonghayCore/blob/master/SonghayCore/SonghayCore.csproj) that supports [multi-targeting](http://gigi.nullneuron.net/gigilabs/multi-targeting-net-standard-class-libraries/), declaring support for `net8.0`.
66

77
**NuGet package 📦:** [`SonghayCore`](https://www.nuget.org/packages/SonghayCore/)
88

SonghayCore.OrderedTests/SonghayCore.OrderedTests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77

@@ -19,17 +19,17 @@
1919
</ItemGroup>
2020

2121
<ItemGroup>
22-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
23-
<PackageReference Include="xunit" Version="2.9.2" />
24-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
22+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
23+
<PackageReference Include="xunit" Version="2.9.3" />
24+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2626
<PrivateAssets>all</PrivateAssets>
2727
</PackageReference>
28-
<PackageReference Include="coverlet.collector" Version="3.1.2">
28+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3030
<PrivateAssets>all</PrivateAssets>
3131
</PackageReference>
32-
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
32+
<PackageReference Include="Xunit.SkippableFact" Version="1.5.23" />
3333
</ItemGroup>
3434

3535
<ItemGroup>
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
using Meziantou.Extensions.Logging.Xunit;
2+
using Microsoft.Extensions.Configuration;
3+
using Microsoft.Extensions.DependencyInjection;
4+
using Microsoft.Extensions.Logging;
5+
using Songhay.Abstractions;
6+
7+
namespace Songhay.Tests.Abstractions;
8+
9+
public class MyActivityTaskWithInput(IConfiguration configuration, ILogger<MyActivityTaskWithInput> logger) : IActivityTask<string>
10+
{
11+
public async Task StartAsync(string? input)
12+
{
13+
await Task.Run(() =>
14+
{
15+
const string key = "actual";
16+
17+
configuration[key] = $"Hello {input}!";
18+
19+
logger.LogInformation("{s}", configuration[key]);
20+
});
21+
}
22+
}
23+
24+
public class MyActivityTaskWithInputAndOutput : IActivityTask<int, string>
25+
{
26+
public async Task<string?> StartAsync(int input)
27+
{
28+
return await Task.FromResult(input switch
29+
{
30+
4 => "walls",
31+
16 => "sweet",
32+
42 => "meaning of life",
33+
_ => null
34+
});
35+
}
36+
}
37+
38+
public class MyOtherActivityTaskWithInputAndOutput : IActivityTask<int, string>
39+
{
40+
public async Task<string?> StartAsync(int input)
41+
{
42+
return await Task.FromResult(input switch
43+
{
44+
4 => "four",
45+
16 => "sixteen",
46+
42 => "forty-two",
47+
_ => null
48+
});
49+
}
50+
}
51+
52+
public class MyOutputActivityTask(
53+
[FromKeyedServices(nameof(MyActivityTaskWithInputAndOutput))]
54+
IActivityTask<int, string> ioActivity,
55+
[FromKeyedServices(nameof(MyOtherActivityTaskWithInputAndOutput))]
56+
IActivityTask<int, string> otherIoActivity) : IActivityOutputOnlyTask<string[]>
57+
{
58+
public async Task<string[]?> StartAsync()
59+
{
60+
var output = await Task.WhenAll(
61+
otherIoActivity.StartAsync(4),
62+
ioActivity.StartAsync(4),
63+
ioActivity.StartAsync(16),
64+
otherIoActivity.StartAsync(16),
65+
otherIoActivity.StartAsync(42),
66+
ioActivity.StartAsync(42)
67+
);
68+
69+
return output.Where(s => !string.IsNullOrWhiteSpace(s)).ToArray()!;
70+
}
71+
}
72+
73+
public class IActivityTaskTestsIActivityTests(ITestOutputHelper testOutputHelper)
74+
{
75+
[Theory]
76+
[InlineData(null, "Hello !")]
77+
[InlineData("world", "Hello world!")]
78+
public async Task ShouldRunMyActivityWithInput(string? input, string? expected)
79+
{
80+
const string actual = "actual";
81+
82+
IConfiguration configuration = new ConfigurationBuilder()
83+
.AddInMemoryCollection(new Dictionary<string, string?>
84+
{
85+
[actual] = null,
86+
})
87+
.Build();
88+
89+
ServiceCollection services = new();
90+
91+
services.AddSingleton(configuration);
92+
services.AddLogging();
93+
services.AddSingleton<ILoggerProvider>(new XUnitLoggerProvider(testOutputHelper, appendScope: false));
94+
services.AddTransient<IActivityTask<string>, MyActivityTaskWithInput>();
95+
96+
ServiceProvider provider = services.BuildServiceProvider();
97+
98+
IActivityTask<string> activity = provider.GetRequiredService<IActivityTask<string>>();
99+
100+
await activity.StartAsync(input);
101+
102+
Assert.Equal(expected, configuration[actual]);
103+
}
104+
105+
[Fact]
106+
public async Task ShouldRunMyOutputActivity()
107+
{
108+
ServiceCollection services = new();
109+
110+
services.AddKeyedTransient<IActivityTask<int, string>, MyActivityTaskWithInputAndOutput>(nameof(MyActivityTaskWithInputAndOutput));
111+
services.AddKeyedTransient<IActivityTask<int, string>, MyOtherActivityTaskWithInputAndOutput>(nameof(MyOtherActivityTaskWithInputAndOutput));
112+
services.AddTransient<IActivityOutputOnlyTask<string[]>, MyOutputActivityTask>();
113+
114+
ServiceProvider provider = services.BuildServiceProvider();
115+
116+
IActivityOutputOnlyTask<string[]> activity = provider.GetRequiredService<IActivityOutputOnlyTask<string[]>>();
117+
var actual = await activity.StartAsync();
118+
119+
Assert.NotNull(actual);
120+
121+
foreach (string s in actual)
122+
{
123+
testOutputHelper.WriteLine(s);
124+
}
125+
}
126+
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
using Microsoft.Extensions.DependencyInjection;
2+
using Microsoft.Extensions.Logging;
3+
using Microsoft.Extensions.Configuration;
4+
using Meziantou.Extensions.Logging.Xunit;
5+
using Songhay.Abstractions;
6+
7+
namespace Songhay.Tests.Abstractions;
8+
9+
public class MyActivityWithInput(IConfiguration configuration, ILogger<MyActivityWithInput> logger) : IActivity<string>
10+
{
11+
public void Start(string? input)
12+
{
13+
const string key = "actual";
14+
15+
configuration[key] = $"Hello {input}!";
16+
17+
logger.LogInformation("{s}", configuration[key]);
18+
}
19+
}
20+
21+
public class MyActivityWithInputAndOutput : IActivity<int, string>
22+
{
23+
public string? Start(int input)
24+
{
25+
return input switch
26+
{
27+
4 => "walls",
28+
16 => "sweet",
29+
42 => "meaning of life",
30+
_ => null
31+
};
32+
}
33+
}
34+
35+
public class MyOtherActivityWithInputAndOutput : IActivity<int, string>
36+
{
37+
public string? Start(int input)
38+
{
39+
return input switch
40+
{
41+
4 => "four",
42+
16 => "sixteen",
43+
42 => "forty-two",
44+
_ => null
45+
};
46+
}
47+
}
48+
49+
public class MyOutputActivity(
50+
[FromKeyedServices(nameof(MyActivityWithInputAndOutput))] IActivity<int, string> ioActivity,
51+
[FromKeyedServices(nameof(MyOtherActivityWithInputAndOutput))] IActivity<int, string> otherIoActivity) : IActivityOutputOnly<string[]>
52+
{
53+
public string[] Start()
54+
{
55+
List<string?> output =
56+
[
57+
otherIoActivity.Start(4),
58+
ioActivity.Start(4),
59+
ioActivity.Start(16),
60+
otherIoActivity.Start(16),
61+
ioActivity.Start(42),
62+
otherIoActivity.Start(42),
63+
];
64+
65+
return output.Where(s => !string.IsNullOrWhiteSpace(s)).ToArray()!;
66+
}
67+
}
68+
69+
public class IActivityTests(ITestOutputHelper testOutputHelper)
70+
{
71+
[Theory]
72+
[InlineData(null, "Hello !")]
73+
[InlineData("world", "Hello world!")]
74+
public void ShouldRunMyActivityWithInput(string? input, string? expected)
75+
{
76+
const string actual = "actual";
77+
78+
IConfiguration configuration = new ConfigurationBuilder()
79+
.AddInMemoryCollection(new Dictionary<string, string?>
80+
{
81+
[actual] = null
82+
})
83+
.Build();
84+
85+
ServiceCollection services = new();
86+
87+
services.AddSingleton(configuration);
88+
services.AddLogging();
89+
services.AddSingleton<ILoggerProvider>(new XUnitLoggerProvider(testOutputHelper, appendScope: false));
90+
services.AddTransient<IActivity<string>, MyActivityWithInput>();
91+
92+
ServiceProvider provider = services.BuildServiceProvider();
93+
94+
IActivity<string> activity = provider.GetRequiredService<IActivity<string>>();
95+
96+
activity.Start(input);
97+
Assert.Equal(expected, configuration[actual]);
98+
}
99+
100+
[Fact]
101+
public void ShouldRunMyOutputActivity()
102+
{
103+
ServiceCollection services = new();
104+
105+
services.AddKeyedTransient<IActivity<int, string>, MyActivityWithInputAndOutput>(nameof(MyActivityWithInputAndOutput));
106+
services.AddKeyedTransient<IActivity<int, string>, MyOtherActivityWithInputAndOutput>(nameof(MyOtherActivityWithInputAndOutput));
107+
services.AddTransient<IActivityOutputOnly<string[]>, MyOutputActivity>();
108+
109+
ServiceProvider provider = services.BuildServiceProvider();
110+
111+
IActivityOutputOnly<string[]> activity = provider.GetRequiredService<IActivityOutputOnly<string[]>>();
112+
var actual = activity.Start();
113+
114+
Assert.NotNull(actual);
115+
116+
foreach (string s in actual)
117+
{
118+
testOutputHelper.WriteLine(s);
119+
}
120+
}
121+
}

0 commit comments

Comments
 (0)