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