독립 검증 도구 추가와 앱 상태 책임 분리

This commit is contained in:
2026-09-06 18:09:11 +09:00
parent 0f0431de5a
commit 002a922e1b
62 changed files with 3454 additions and 2008 deletions
@@ -0,0 +1,31 @@
using NUnit.Framework;
using ProjectQuint.Probes;
namespace ProjectQuint.Tests
{
public sealed class CoreBenchmarkTests
{
[Test]
public void Benchmark_CheckpointsAreIncompleteUntilEverySampleFinishes()
{
var checkpoints = 0;
var report = CoreBenchmark.Run(100, 42, 60, 3, checkpoint =>
{
++checkpoints;
Assert.That(checkpoint.Complete, Is.False);
Assert.That(checkpoint.Samples.Length, Is.EqualTo(checkpoints));
Assert.That(checkpoint.Samples[0].Judgement.Finished, Is.True);
});
Assert.That(report.Complete, Is.True);
Assert.That(checkpoints, Is.EqualTo(3));
Assert.That(report.Samples.Length, Is.EqualTo(3));
Assert.That(report.WarmupIterations, Is.EqualTo(3));
}
[TestCase(0)]
[TestCase(101)]
public void Benchmark_RejectsInvalidIterationCount(int iterations) =>
Assert.Throws<System.ArgumentOutOfRangeException>(() =>
CoreBenchmark.Run(100, 42, 60, iterations, _ => { }));
}
}