1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-22 19:28:48 +00:00

test: 100% coverage on MultiplicativePersistence

This commit is contained in:
Oliver Booth 2023-03-31 23:19:21 +01:00
parent ee0df8c9c2
commit 6e7e162ffe
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025
8 changed files with 72 additions and 0 deletions

View File

@ -122,6 +122,15 @@ public partial class ByteTests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, ((byte)10).MultiplicativePersistence());
Assert.AreEqual(1, ((byte)201).MultiplicativePersistence());
Assert.AreEqual(1, ((byte)200).MultiplicativePersistence());
Assert.AreEqual(1, ((byte)207).MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -134,6 +134,15 @@ public partial class Int16Tests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, ((short)10).MultiplicativePersistence());
Assert.AreEqual(1, ((short)201).MultiplicativePersistence());
Assert.AreEqual(1, ((short)200).MultiplicativePersistence());
Assert.AreEqual(1, ((short)20007).MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -134,6 +134,15 @@ public partial class Int32Tests
Assert.AreEqual(expected, result2);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, 10.MultiplicativePersistence());
Assert.AreEqual(1, 201.MultiplicativePersistence());
Assert.AreEqual(1, 200.MultiplicativePersistence());
Assert.AreEqual(1, 20007.MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -134,6 +134,15 @@ public partial class Int64Tests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, 10L.MultiplicativePersistence());
Assert.AreEqual(1, 201L.MultiplicativePersistence());
Assert.AreEqual(1, 200L.MultiplicativePersistence());
Assert.AreEqual(1, 20007L.MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -135,6 +135,15 @@ public partial class SByteTests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, ((sbyte)10).MultiplicativePersistence());
Assert.AreEqual(1, ((sbyte)20).MultiplicativePersistence());
Assert.AreEqual(1, ((sbyte)101).MultiplicativePersistence());
Assert.AreEqual(1, ((sbyte)120).MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -123,6 +123,15 @@ public partial class UInt16Tests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, ((ushort)10).MultiplicativePersistence());
Assert.AreEqual(1, ((ushort)201).MultiplicativePersistence());
Assert.AreEqual(1, ((ushort)200).MultiplicativePersistence());
Assert.AreEqual(1, ((ushort)20007).MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -123,6 +123,15 @@ public partial class UInt32Tests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, 10U.MultiplicativePersistence());
Assert.AreEqual(1, 201U.MultiplicativePersistence());
Assert.AreEqual(1, 200U.MultiplicativePersistence());
Assert.AreEqual(1, 20007U.MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{

View File

@ -125,6 +125,15 @@ public partial class UInt64Tests
Assert.AreEqual(expected, result);
}
[TestMethod]
public void MultiplicativePersistence_ShouldReturn1_ForAnyDigitBeing0()
{
Assert.AreEqual(1, 10UL.MultiplicativePersistence());
Assert.AreEqual(1, 201UL.MultiplicativePersistence());
Assert.AreEqual(1, 200UL.MultiplicativePersistence());
Assert.AreEqual(1, 20007UL.MultiplicativePersistence());
}
[TestMethod]
public void MultiplicativePersistence_ShouldBeCorrect_ForRecordHolders()
{