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
@@ -13,7 +13,7 @@ public class UIntExtensionsTests
|
||||
[InlineData(uint.MaxValue)]
|
||||
public void Mod3_matches_operator(uint value)
|
||||
{
|
||||
value.Mod3().Should().Be(value % 3U);
|
||||
UIntExtensions.Mod3(value).Should().Be(value % 3U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -27,28 +27,6 @@ public class UIntExtensionsTests
|
||||
value.Mod5().Should().Be(value % 5U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0U)]
|
||||
[InlineData(1U)]
|
||||
[InlineData(1234567890U)]
|
||||
[InlineData(uint.MaxValue)]
|
||||
public void Mod6_matches_operator(uint value)
|
||||
{
|
||||
value.Mod6().Should().Be(value % 6U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0U)]
|
||||
[InlineData(1U)]
|
||||
[InlineData(1234567890U)]
|
||||
[InlineData(uint.MaxValue)]
|
||||
public void Mod7_matches_operator(uint value)
|
||||
{
|
||||
value.Mod7().Should().Be(value % 7U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0U)]
|
||||
@@ -59,38 +37,5 @@ public class UIntExtensionsTests
|
||||
{
|
||||
value.Mod8().Should().Be(value % 8U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0U)]
|
||||
[InlineData(1U)]
|
||||
[InlineData(1234567890U)]
|
||||
[InlineData(uint.MaxValue)]
|
||||
public void Mod10_matches_operator(uint value)
|
||||
{
|
||||
value.Mod10().Should().Be(value % 10U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0U)]
|
||||
[InlineData(1U)]
|
||||
[InlineData(1234567890U)]
|
||||
[InlineData(uint.MaxValue)]
|
||||
public void Mod11_matches_operator(uint value)
|
||||
{
|
||||
value.Mod11().Should().Be(value % 11U);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[Trait("Category", "Fast")]
|
||||
[InlineData(0U)]
|
||||
[InlineData(1U)]
|
||||
[InlineData(1234567890U)]
|
||||
[InlineData(uint.MaxValue)]
|
||||
public void Mod128_matches_operator(uint value)
|
||||
{
|
||||
value.Mod128().Should().Be(value % 128U);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user