public void Get_WhenRulesHaveBeenCleared_AlwaysReturnsTheNumber() { var fb = new FizzBuzz(15); fb.Rules.Clear(); for (UInt64 i = 1; i <= fb.countTo; i++) { Assert.AreEqual(i.ToString(), fb.Get(i)); } }
public void Get_WithDefaultRulesAnd15_ReturnsFizzBuzz() { var fb = new FizzBuzz(); Assert.AreEqual("fizzbuzz", fb.Get(15)); }
public void Get_GivenValueLessThanStartFrom_ThrowsException() { var fb = new FizzBuzz(); fb.Get(0); }
public void Get_GivenZeroAppropriately_WillReturnCorrectResult() { var fb = new FizzBuzz(1,0); Assert.AreEqual("fizzbuzz", fb.Get(0)); }
public void Get_GivenUInt64MaxAppropriately_WillReturnCorrectResult() { var fb = new FizzBuzz(UInt64.MaxValue); Assert.AreEqual("fizzbuzz", fb.Get(UInt64.MaxValue)); }
public void Get_GivenValueGreaterThanCountTo_ThrowsException() { var fb = new FizzBuzz(); fb.Get(101); }
public void Get_WithNewApplicableRuleInsertedAtStart_ReturnsPopFizzBuzz() { var fb = new FizzBuzz(); fb.Rules.Insert(0, new Rule(2, "pop")); Assert.AreEqual("popfizzbuzz", fb.Get(30)); }
public void Get_WithNewApplicableRuleAtEnd_ReturnsFizzBuzzPop() { var fb = new FizzBuzz(); fb.Rules.Add(new Rule(2, "pop")); Assert.AreEqual("fizzbuzzpop", fb.Get(30)); }
public void Get_WithNewApplicableDuplicateRuleAtEnd_ReturnsFizzBuzzPopBang() { var fb = new FizzBuzz(); fb.Rules.Add(new Rule(2, "pop")); fb.Rules.Add(new Rule(2, "bang")); Assert.AreEqual("fizzbuzzpopbang", fb.Get(30), "Expected both 'duplicate' rules to apply."); }
public void Get_WithDefaultRulesAndCountToValue_ReturnsFizzBuzz() { var fb = new FizzBuzz(); Assert.AreEqual("buzz", fb.Get(fb.countTo), "expected that the countTo value (which should be the top bound) would return a valid string result."); }
public void Get_WithDefaultRulesAnd1_Returns1() { var fb = new FizzBuzz(); Assert.AreEqual("1", fb.Get(1)); }