public void SetUp() { _kata = new FizzBuzzKata(new List<IDivisbleRule> { new DivisibleByThree(), new DivisibleByFive() }); }
public void ShouldReturnMixedFizzBuzzOrNumber(int value, string expected) { // arrange var kata = new FizzBuzzKata(); // act var result = kata.Verify(value); // assert Assert.That(result, Is.EqualTo(expected)); }
public void ReturnsNeitherWhenitsNotDivisbleBy3Or5() { //Arrange var fizzBuzzKata = new FizzBuzzKata(); var answersList = new ArrayList(); //Act answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(4)); answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(88)); answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(1357)); answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(125537)); //Assert foreach (var answer in answersList) { Assert.That(answer.Equals("NEITHER")); } }
public void ReturnsFizzBuzzWhenGivenANumberDivisbleByBoth3And5() { //Arrange var fizzBuzzKata = new FizzBuzzKata(); var answersList = new ArrayList(); //Act answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(15)); answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(30)); answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(1500)); answersList.Add(fizzBuzzKata.AreYouAFizzBuzzOrNot(5550)); //Assert foreach (var answer in answersList) { Assert.That(answer.Equals("FIZZBUZZ")); } }
public void TestExample() { // Arrange var fizzBuzzKata = new FizzBuzzKata(); // Act + Assert Assert.AreEqual("1", fizzBuzzKata.Answer(1)); Assert.AreEqual("2", fizzBuzzKata.Answer(2)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(3)); Assert.AreEqual("4", fizzBuzzKata.Answer(4)); Assert.AreEqual("buzz", fizzBuzzKata.Answer(5)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(6)); Assert.AreEqual("7", fizzBuzzKata.Answer(7)); Assert.AreEqual("8", fizzBuzzKata.Answer(8)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(9)); Assert.AreEqual("buzz", fizzBuzzKata.Answer(10)); Assert.AreEqual("11", fizzBuzzKata.Answer(11)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(12)); Assert.AreEqual("13", fizzBuzzKata.Answer(13)); Assert.AreEqual("14", fizzBuzzKata.Answer(14)); Assert.AreEqual("fizzbuzz", fizzBuzzKata.Answer(15)); }
public void TestExample() { // Arrange var fizzBuzzKata = new FizzBuzzKata(); // Act + Assert Assert.AreEqual("1", fizzBuzzKata.Answer(1)); Assert.AreEqual("2", fizzBuzzKata.Answer(2)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(3)); Assert.AreEqual("4", fizzBuzzKata.Answer(4)); Assert.AreEqual("buzz", fizzBuzzKata.Answer(5)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(6)); Assert.AreEqual("7", fizzBuzzKata.Answer(7)); Assert.AreEqual("8", fizzBuzzKata.Answer(8)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(9)); Assert.AreEqual("buzz", fizzBuzzKata.Answer(10)); Assert.AreEqual("11", fizzBuzzKata.Answer(11)); Assert.AreEqual("fizz", fizzBuzzKata.Answer(12)); Assert.AreEqual("13", fizzBuzzKata.Answer(13)); Assert.AreEqual("14", fizzBuzzKata.Answer(14)); Assert.AreEqual("fizzbuzz", fizzBuzzKata.Answer(15)); }
public void TestFizzBuzzWithFifteen() { Assert.AreEqual("12Fizz4BuzzFizz78FizzBuzz11FizzFizz14FizzBuzz", FizzBuzzKata.FizzBuzz(15)); }
public void TestFizzBuzzWithFive() { Assert.AreEqual("12Fizz4Buzz", FizzBuzzKata.FizzBuzz(5)); }
public void init() { fizzBuzz = new FizzBuzzKata(); }