champions-of-luneraria/Assets/Luneraria/Tests/Core/CheckSuite.cs
Martin Stickelbroeck 8e4b52f4ab S1 Strategie-Regeln nach Legion TD 2, Dota 2 und League of Legends
Hinter MatchOptions.Extended (Standard im Spiel, Schalter im Startbildschirm):
Söldner-Einkommen (Angriffschampion +Preis/12 Einkommen dauerhaft), Kasernen
(gefallener innerer Turm: Gegnerwellen +25 % und ein Monster mehr), Erschöpfung
und Rückkauf (60 % Leben, Rückkauf 60 + 20 x Stufe), Mondsegen (Grottensieg
+4 % je Stapel, Mondseele bei 4). Bots wählen mit erweiterten Regeln auch
Sylvara und kaufen Helden zurück. Netz überträgt Regeln und neue Zustände.
HUD: Einkommen, Kasernen-Symbol, Rückkauf, Segen im Teamkopf.
Kern 531/531 (s1 31), EditMode 31/31, PlayMode 16/16, Verify 718/0,
Selbsttest 30/30, Golden 0 Abweichungen, Fingerabdruck unverändert.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 12:18:47 +02:00

56 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
namespace Luneraria.Core.Tests
{
/// <summary>
/// A test suite in the style of the Godot reference tests: named checks, counted, failures
/// collected with their label. The same suites run in the .NET harness (tools/dotnet) and in
/// Unity's Test Runner (Unity/CoreSuiteTests.cs); check counts stay comparable with Godot.
/// </summary>
public abstract class CheckSuite
{
public int Checks { get; private set; }
public readonly List<string> Failures = new List<string>();
public readonly List<string> Notes = new List<string>();
/// <summary>Folder with the golden files (Assets/Luneraria/Tests/Core/Golden).</summary>
public string GoldenDirectory = "";
public abstract string Name { get; }
protected abstract void RunChecks();
public bool Run()
{
Checks = 0;
Failures.Clear();
Notes.Clear();
try
{
RunChecks();
}
catch (Exception error)
{
Failures.Add("EXCEPTION " + error.GetType().Name + ": " + error.Message + "\n" + error.StackTrace);
}
return Failures.Count == 0;
}
protected void Check(bool ok, string label)
{
Checks += 1;
if (!ok)
Failures.Add(label);
}
protected void Note(string text)
{
Notes.Add(text);
}
public static IList<CheckSuite> All()
{
return new List<CheckSuite> { new ContentSuite(), new CoreRulesSuite(), new M2RulesSuite(), new GoldenSuite(), new DeterminismSuite(), new NetSuite(), new NetRoundsSuite(), new H1HeroSuite(), new S1RulesSuite() };
}
}
}