feat: create request projects for basic CQRS
This commit is contained in:
commit
d614788e06
190 changed files with 12236 additions and 0 deletions
49
src/request.dispatcher.tests/PackageContentsTests.cs
Normal file
49
src/request.dispatcher.tests/PackageContentsTests.cs
Normal 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");
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue