Initial commit.

This commit is contained in:
Marek Lemańczyk committed 2025-09-09 21:15:57 +02:00
1 parent e5b0fea18c
commit 9f35f6c558
94 files changed
+12857

No files matched your search

@@ -0,0 +1,37 @@
using FluentAssertions;
using Xunit;
namespace PerfectNumbers.Core.Tests;
public class MersenneResidueStepperTests
{
[Fact]
[Trait("Category", "Fast")]
public void Step_advances_residue()
{
var stepper = new MersenneResidueStepper(13, 4, 2);
stepper.State().Should().Be((4UL, 2UL));
stepper.Step(3).Should().Be((7UL, 10UL));
}
[Fact]
[Trait("Category", "Fast")]
public void To_moves_directly_to_target_exponent()
{
var stepper = new MersenneResidueStepper(13, 4, 2);
stepper.To(10).Should().Be((10UL, 9UL));
}
[Fact]
[Trait("Category", "Fast")]
public void Constructor_rejects_zero_modulus()
{
var act = () => new MersenneResidueStepper(0, 0, 0);
act.Should().Throw<ArgumentException>();
}
}