Files
poli0981andClaude Fable 5.2 1342979353 ci: Qodana - JetBrains' code analysis from a workflow of its own, and what its first run reported settled (D93) (#373)
* ci: Qodana - a workflow of its own from JetBrains' template, Qodana Community for .NET over FrameLedger.slnx (D93)

The first run: the linter in its Linux container, EnableWindowsTargeting passed
to it, no quality gate yet - what it builds and what it reports decides the rest.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* ci: Qodana's gate is zero problems, and the inspections this project argues with are off in .editorconfig, each with its reason (D93)

Pushed before the fixes on purpose: the run this starts has the settings and
none of the fixes, so it shows the gate failing on what is left.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* fix: what Qodana's first run reported, settled - about 400 fixes in 181 files, none changing behaviour; the documents (D93)

Redundant qualifiers, casts, using directives, nullable suppressions and unsafe
modifiers removed from the report's own positions; var for built-in types and
one-line block bodies brought to .editorconfig's style by dotnet format; every
XAML item template names its DataType and a binding that reached its page through
DataContext.ViewModel names the page's type; two unread fields, two overwritten
initialisers and an unused parameter removed; SpokenTextAutomationPeer no longer
assumes the base peer's name is a string.

docs/13_CI_CD.md §Qodana, CLAUDE.md, the wiki's workflow table, HANDOFF's
decisions index (D93) and the changelog entry.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 16:13:04 +00:00

68 lines
2.0 KiB
C#

// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Infrastructure.Import;
namespace FrameLedger.Infrastructure.Tests.Import;
/// <summary>RPG Maker's own title for a hand-added <c>Game.exe</c> (2026-09-23), read from real files in a scratch tree.</summary>
public sealed class RpgMakerTitleTests : IDisposable
{
private readonly string _root = Path.Combine(Path.GetTempPath(), "fl-rpgtitle-" + Guid.NewGuid().ToString("N"));
public void Dispose()
{
try
{
Directory.Delete(_root, recursive: true);
}
catch (IOException)
{
}
}
private string Write(string relative, string content)
{
string path = Path.Combine(_root, relative);
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
File.WriteAllText(path, content);
return path;
}
[Fact]
public void AnMvTitleBesideTheExecutableIsRead()
{
string exe = Write(@"HHW\swiftshader\Game.exe", "");
Write(@"HHW\swiftshader\www\data\System.json", "{\"gameTitle\":\"HELLO, HELLO WORLD!\",\"locale\":\"en_US\"}");
RpgMakerTitle.TryRead(exe).Should().Be("HELLO, HELLO WORLD!");
}
[Fact]
public void AnMzTitleAFolderAboveIsRead()
{
string exe = Write(@"MZ\runtime\Game.exe", "");
Write(@"MZ\data\System.json", "{\"gameTitle\":\" An MZ Game \"}");
RpgMakerTitle.TryRead(exe).Should().Be("An MZ Game");
}
[Theory]
[InlineData("{\"locale\":\"en_US\"}")]
[InlineData("{\"gameTitle\":\"\"}")]
[InlineData("{\"gameTitle\":42}")]
[InlineData("not json")]
[InlineData("[]")]
public void NoUsableTitleIsNull(string content)
{
string exe = Write(@"Bad\Game.exe", "");
Write(@"Bad\www\data\System.json", content);
RpgMakerTitle.TryRead(exe).Should().BeNull();
}
[Fact]
public void NoFileIsNull() => RpgMakerTitle.TryRead(Write(@"None\Game.exe", "")).Should().BeNull();
}