Files
poli0981andClaude Opus 4.8 ef83c88083 build: add assembly metadata + Velopack --packAuthors
Đợt 1 of the post-v1.0 line (metadata + packaging).

- Directory.Build.props: inheritable package/assembly metadata
  (Product, Authors/Company=poli0981, Copyright, Description,
  RepositoryUrl/PackageProjectUrl, default Version 1.0.0).
  AssemblyVersion is intentionally NOT pinned so it follows Version
  (stamped from the git tag at publish), keeping the in-app About /
  Report-Bug version accurate.
- scripts/pack.ps1: pass --packTitle / --packAuthors to vpk pack
  (correct plural flag) and -p:FileVersion to dotnet publish.
- tests: AssemblyMetadataTests verifies Company / Product / Copyright.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 13:58:54 +07:00

33 lines
1.2 KiB
C#

using System.Reflection;
using CommandForge.Domain;
namespace CommandForge.Tests;
/// <summary>
/// Verifies the package/assembly metadata declared in Directory.Build.props is stamped into
/// the built assemblies. This metadata is surfaced in Settings -> About, the Report-Bug
/// template, the file properties, and the Velopack installer (--packAuthors).
/// </summary>
public sealed class AssemblyMetadataTests
{
// Domain is the lowest layer and inherits the same Directory.Build.props metadata as the rest.
private static readonly Assembly Target = typeof(CommandDefinition).Assembly;
[Fact]
public void Assembly_HasExpectedCompany()
=> Assert.Equal("poli0981", Target.GetCustomAttribute<AssemblyCompanyAttribute>()?.Company);
[Fact]
public void Assembly_HasExpectedProduct()
=> Assert.Equal("CommandForge", Target.GetCustomAttribute<AssemblyProductAttribute>()?.Product);
[Fact]
public void Assembly_HasCopyrightWithOwner()
{
var copyright = Target.GetCustomAttribute<AssemblyCopyrightAttribute>()?.Copyright;
Assert.NotNull(copyright);
Assert.Contains("poli0981", copyright, StringComparison.Ordinal);
}
}