mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 22:55:42 +00:00
test: 100% coverage on MultiplicativePersistence
This commit is contained in:
parent
ee0df8c9c2
commit
6e7e162ffe
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user