public void When_The_Start_Is_Greater_Than_The_End() { var instance = new ModuloThreeAndFiveSubstitutionSequenceCalculator(); var result = instance.Evaluate(11, 10); result.ToArray(); Assert.Fail("Should have exceptioned..."); }
public void When_A_Larger_Range_Is_Selected_Multiples_Of_Both_Three_And_Five_Are_Subsituted() { var instance = new ModuloThreeAndFiveSubstitutionSequenceCalculator(); var result = instance.Evaluate(0, 31); Assert.IsNotNull(result); Assert.IsTrue(result.Any()); Assert.AreEqual("0", result.First()); Assert.AreEqual("31", result.Last()); Assert.AreEqual(32, result.Count()); Assert.AreEqual(2, result.Count(r => r == "Z")); Assert.AreEqual("Z", result.Skip(15).First()); Assert.AreEqual("Z", result.Skip(30).First()); }
public void When_A_Simple_Small_Range_Is_Selected_Both_Threes_And_Fives_Are_Subsituted() { var instance = new ModuloThreeAndFiveSubstitutionSequenceCalculator(); var result = instance.Evaluate(0, 11); Assert.IsNotNull(result); Assert.IsTrue(result.Any()); Assert.AreEqual("0", result.First()); Assert.AreEqual("11", result.Last()); Assert.AreEqual(12, result.Count()); Assert.AreEqual(3, result.Count(r => r == "C")); // Number of values divisible by 3 Assert.AreEqual(2, result.Count(r => r == "E")); // Number of values divisible by 5 Assert.AreEqual("0 1 2 C 4 E C 7 8 C E 11", String.Join(" ", result.ToArray())); }