コード例 #1
0
 public static void CountWaysToMakeChange_HandlesNullCorrectly()
 {
     Assert.Throws <ArgumentNullException>(() => MakingChange.CountWaysToMakeChange(4, null));
 }
コード例 #2
0
 public static void CountWaysToMakeChange_HandlesNoDenominations_And_ZeroAmount()
 {
     Assert.That(MakingChange.CountWaysToMakeChange(0, new int[] {}), Is.EqualTo(1));
 }
コード例 #3
0
 public static void CountWaysToMakeChange_HandlesNoDenominations()
 {
     Assert.That(MakingChange.CountWaysToMakeChange(4, new int[] {}), Is.EqualTo(0));
 }
コード例 #4
0
 public static void CountWaysToMakeChange_HandlesNegativeDenomination()
 {
     Assert.Throws <ArgumentException>(() => MakingChange.CountWaysToMakeChange(4, new int[] { 1, 2, -3 }));
 }
コード例 #5
0
 public static void CountWaysToMakeChange_HandlesNoWayToMakeChange()
 {
     Assert.That(MakingChange.CountWaysToMakeChange(7, new int[] { 3 }), Is.EqualTo(0));
 }
コード例 #6
0
 public static void CountWaysToMakeChange_BasicExample_ReturnsExpected()
 {
     Assert.That(MakingChange.CountWaysToMakeChange(4, new int[] { 1, 2, 3 }), Is.EqualTo(4));
 }