feat: create request projects for basic CQRS

This commit is contained in:
Louis Seubert 2026-05-08 20:26:26 +02:00
commit d614788e06
Signed by: louis9902
GPG key ID: 4B9DB28F826553BD
190 changed files with 12236 additions and 0 deletions

View file

@ -0,0 +1,49 @@
// Copyright (c) The Geekeey Authors
// SPDX-License-Identifier: EUPL-1.2
using System.Diagnostics;
using System.IO.Compression;
namespace Geekeey.Request.Tests;
internal sealed class PackageContentsTests
{
private static string RepoRoot => Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..");
private static string ArtifactsDir => Path.Combine(RepoRoot, "artifacts");
private static string ProjectPath => Path.Combine(RepoRoot, "src", "request.dispatcher", "Geekeey.Request.Dispatcher.csproj");
private readonly string _outputDir;
public PackageContentsTests()
{
_outputDir = Path.Combine(ArtifactsDir, Path.GetRandomFileName());
}
[Before(Test)]
public async Task SetUpAsync()
{
Directory.CreateDirectory(_outputDir);
}
[After(Test)]
public async Task CleanUpAsync()
{
Directory.Delete(_outputDir, true);
}
[Test]
public async Task I_can_verify_the_package_contains_the_expected_contents()
{
using var process = Process.Start("dotnet", $"pack \"{ProjectPath}\" -o \"{_outputDir}\" -c Release");
await process.WaitForExitAsync();
var pkgs = Directory.GetFiles(_outputDir, "*.nupkg");
await Assert.That(pkgs.Length).IsGreaterThanOrEqualTo(1);
await using var archive = await ZipFile.OpenReadAsync(pkgs[0]);
var entries = archive.Entries.Select(entry => entry.FullName.Replace('\\', '/')).ToHashSet();
await Assert.That(entries).Contains("lib/net10.0/Geekeey.Request.Dispatcher.dll");
await Assert.That(entries).Contains("lib/net10.0/Geekeey.Request.Dispatcher.xml");
}
}