Initial commit.
This commit is contained in:
1 parent
e5b0fea18c
commit
9f35f6c558
94 files changed
+12857
No files matched your search
@@ -0,0 +1,25 @@
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
namespace PerfectNumbers.Core.Tests;
|
||||
|
||||
[Trait("Category", "Fast")]
|
||||
public class PrimeTesterGcdTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(81UL, true)]
|
||||
[InlineData(101UL, false)]
|
||||
public void SharesFactorWithMaxExponent_detects_gcd(ulong n, bool expected)
|
||||
{
|
||||
PrimeTester.SharesFactorWithMaxExponent(n).Should().Be(expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SharesFactorWithMaxExponentBatch_filters_values()
|
||||
{
|
||||
ulong[] values = [81UL, 101UL];
|
||||
Span<byte> results = stackalloc byte[values.Length];
|
||||
PrimeTester.SharesFactorWithMaxExponentBatch(values, results);
|
||||
results.ToArray().Should().Equal(new byte[] { 1, 0 });
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user