Extension methods benchmarked. Slower alternatives replaced.
This commit is contained in:
1 parent
9becb8df67
commit
6e99ee39e3
40 files changed
+930
-1026
No files matched your search
@@ -21,66 +21,6 @@ public class ULongExtensionsTests
|
||||
ULongExtensions.Mod10(value).Should().Be(expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
public void Mod3_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod3().Should().Be(value % 3UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
public void Mod5_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod5().Should().Be(value % 5UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
public void Mod6_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod6().Should().Be(value % 6UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
public void Mod7_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod7().Should().Be(value % 7UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
public void Mod8_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod8().Should().Be(value % 8UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
public void Mod11_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod11().Should().Be(value % 11UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
@@ -111,22 +51,6 @@ public class ULongExtensionsTests
|
||||
step3.Should().Be(expected3);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0UL)]
|
||||
[InlineData(1UL)]
|
||||
[InlineData(1234567890123456789UL)]
|
||||
[InlineData(ulong.MaxValue)]
|
||||
public void Mod11_7_5_3_matches_operator(ulong value)
|
||||
{
|
||||
value.Mod11_7_5_3(out ulong mod11, out ulong mod7, out ulong mod5, out ulong mod3);
|
||||
|
||||
mod11.Should().Be(value % 11UL);
|
||||
mod7.Should().Be(value % 7UL);
|
||||
mod5.Should().Be(value % 5UL);
|
||||
mod3.Should().Be(value % 3UL);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(2UL, true)]
|
||||
|
||||
Reference in new issue
Block a user