Browse files

touchdown. with nunit the the kata could benefit from the parameteriz…

…ation feature which eliminated redundancy on test side and forced me to describe the algorithm (behavior) instead of the plain samples.
  • Loading branch information...
1 parent 5f815f8 commit 8f9cda85269bd3844b35581ff68d8f3e1938b43f @ilkerde committed Jan 20, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 KataProbability.NUnit/ProbabilityTests.cs
View
5 KataProbability.NUnit/ProbabilityTests.cs
@@ -27,15 +27,16 @@ public class When_the_combined_probability_of_two_is_required {
[TestFixture]
public class When_either_probability_of_two_is_required {
- [TestCase(0.5,0.5, 0.75)]
- [TestCase(0.5,0.1, 0.55)]
+ [TestCase(0.5, 0.5, 0.75)]
+ [TestCase(0.5, 0.1, 0.55)]
public void Then_either_is_sum_of_both_minus_combination_of_both(decimal firstValue, decimal secondValue, decimal expectedValue) {
Assert.AreEqual(
P.Of(firstValue).Either(P.Of(secondValue)),
P.Of(expectedValue)
);
}
}
+
public static class P {
public static Probability Of(decimal value) {
return new Probability(value);

0 comments on commit 8f9cda8

Please sign in to comment.