Exemplo n.º 1
0
        public void KFBTest_InputOutOfRange_ExpectEmptyString()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("", kfb.FizzBuzz(0));
            Assert.AreEqual("", kfb.FizzBuzz(101));
            Assert.AreEqual("", kfb.FizzBuzz(256));
        }
Exemplo n.º 2
0
        public void KFBTest_InputNonDivisibleNumber_ExpectNumber()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("1", kfb.FizzBuzz(1));
            Assert.AreEqual("2", kfb.FizzBuzz(2));
            Assert.AreEqual("4", kfb.FizzBuzz(4));
        }
Exemplo n.º 3
0
        public void FizzBuzzTest()
        {
            KataFizzBuzz fizzbuzz = new KataFizzBuzz();

            Assert.AreEqual("FizzBuzz", fizzbuzz.FizzBuzz(15));
            Assert.AreEqual("FizzBuzz", fizzbuzz.FizzBuzz(90));
            Assert.AreEqual("FizzBuzz", fizzbuzz.FizzBuzz(60));
            Assert.AreEqual("FizzBuzz", fizzbuzz.FizzBuzz(75));
        }
Exemplo n.º 4
0
        public void BuzzTest()
        {
            KataFizzBuzz buzz = new KataFizzBuzz();

            Assert.AreEqual("Buzz", buzz.FizzBuzz(10));
            Assert.AreEqual("Buzz", buzz.FizzBuzz(35));
            Assert.AreEqual("Buzz", buzz.FizzBuzz(95));
            Assert.AreEqual("Buzz", buzz.FizzBuzz(55));
            Assert.AreEqual("Buzz", buzz.FizzBuzz(5));
        }
Exemplo n.º 5
0
        public void BoundaryTest()
        {
            KataFizzBuzz nofizzorbuzz = new KataFizzBuzz();

            Assert.AreEqual("", nofizzorbuzz.FizzBuzz(-1));
            Assert.AreEqual("", nofizzorbuzz.FizzBuzz(105));
            Assert.AreEqual("", nofizzorbuzz.FizzBuzz(101));
            Assert.AreEqual("", nofizzorbuzz.FizzBuzz(509));
            Assert.AreEqual("", nofizzorbuzz.FizzBuzz(-78));
        }
Exemplo n.º 6
0
        public void KFBTest_ContainsOrIsDivisibleByBoth_ExpectFizzBuzz()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("FizzBuzz", kfb.FizzBuzz(15));
            Assert.AreEqual("FizzBuzz", kfb.FizzBuzz(30));
            Assert.AreEqual("FizzBuzz", kfb.FizzBuzz(45));
            Assert.AreEqual("FizzBuzz", kfb.FizzBuzz(54));
            Assert.AreEqual("FizzBuzz", kfb.FizzBuzz(35));
        }
Exemplo n.º 7
0
        public void FizzTest()
        {
            KataFizzBuzz fizz = new KataFizzBuzz();

            Assert.AreEqual("Fizz", fizz.FizzBuzz(6));
            Assert.AreEqual("Fizz", fizz.FizzBuzz(87));
            Assert.AreEqual("Fizz", fizz.FizzBuzz(57));
            Assert.AreEqual("Fizz", fizz.FizzBuzz(33));
            Assert.AreEqual("Fizz", fizz.FizzBuzz(18));
        }
        [DataRow(0, "")] //worked with Hala and Tom, was told to reference the student book!

        public void FizzBuzzTest(int i, string enteredString)
        {
            KataFizzBuzz testClass = new KataFizzBuzz();
            string       result    = testClass.FizzBuzz(i);

            Assert.AreEqual(enteredString, result);
        }
        public void ShouldReturnFizzIfDivisibleBy3OrIncludes3(int input, string expectedResult)
        {
            //arrange
            KataFizzBuzz newFizzBuzz = new KataFizzBuzz();
            //act
            string actualresult = newFizzBuzz.FizzBuzz(input);

            //assert
            Assert.AreEqual(expectedResult, actualresult);
        }
        public void ShouldReturnFizzBuzzIfDivisibleBy3And5OrIfContains3And5AndOverridesRuleAbout3And5(int input, string expectedResult)
        {
            //arrange
            KataFizzBuzz newFizzBuzz = new KataFizzBuzz();
            //act
            string actualResult = newFizzBuzz.FizzBuzz(input);

            //assert
            Assert.AreEqual(expectedResult, actualResult);
        }
        public void DoesFizzBuzzReturnCorrectString(int input, string expected)
        {
            //Arrange
            KataFizzBuzz inputString = new KataFizzBuzz();
            //Act
            string result = inputString.FizzBuzz(input);

            //Assert
            Assert.AreEqual(expected, result);
        }
        public void ShouldReturnNumberStringIfWithin1And100AndNotDivisibleAndNotFollowingOtherRules(int input, string expectedResult)
        {
            //arrange
            KataFizzBuzz newFizzBuzz = new KataFizzBuzz();
            //act
            string result = newFizzBuzz.FizzBuzz(input);

            //assert
            Assert.AreEqual(expectedResult, result);
        }
        public void ShouldReturnEmptyStringIfInputIsOver100OrUnder1(int input, string expectedResult)
        {
            //arrange
            KataFizzBuzz newFizzBuzz = new KataFizzBuzz();
            //act
            string result = newFizzBuzz.FizzBuzz(input);

            //assert
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 14
0
        public void FizzBuzzDivideBy3And5()
        {
            //Arrange
            string actualStringResult;
            string actualStringResultForNumber60;
            string expectedStringForNumber15 = "FizzBuzz";
            string expectedStringForNumber60 = "FizzBuzz";

            //Act
            actualStringResult            = emptyString.FizzBuzz(15);
            actualStringResultForNumber60 = emptyString.FizzBuzz(60);
            //Assert
            Assert.AreEqual(expectedStringForNumber15, actualStringResult);
            Assert.AreEqual(expectedStringForNumber60, actualStringResultForNumber60);
        }
Exemplo n.º 15
0
        public void KFBTest_DivisibleByOrContains5_ExpectBuzz()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("Buzz", kfb.FizzBuzz(5));
            Assert.AreEqual("Buzz", kfb.FizzBuzz(10));
            Assert.AreEqual("Buzz", kfb.FizzBuzz(25));
            Assert.AreEqual("Buzz", kfb.FizzBuzz(56));
            Assert.AreEqual("Buzz", kfb.FizzBuzz(52));
            Assert.AreEqual("Buzz", kfb.FizzBuzz(59));
        }
Exemplo n.º 16
0
        public void KFBTest_DivisibleByOrContains3_ExpectFizz()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("Fizz", kfb.FizzBuzz(3));
            Assert.AreEqual("Fizz", kfb.FizzBuzz(6));
            Assert.AreEqual("Fizz", kfb.FizzBuzz(9));
            Assert.AreEqual("Fizz", kfb.FizzBuzz(13));
            Assert.AreEqual("Fizz", kfb.FizzBuzz(23));
            Assert.AreEqual("Fizz", kfb.FizzBuzz(37));
        }
 public void FizzBuzzDivisibleBy3()
 {
     Assert.AreEqual("Fizz", kataFizzBuzz.FizzBuzz(3));
 }
Exemplo n.º 18
0
        public void FizzBuzz_Four_ReturnStringFour()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("4", kfb.FizzBuzz(4));
        }
Exemplo n.º 19
0
        public void FizzBuzz_ReturnBuzz_WhenDivisibleByFive()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("Buzz", kfb.FizzBuzz(25));
        }
Exemplo n.º 20
0
        public void FizzBuzz_ReturnFizz_WhenContainsThree()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("Fizz", kfb.FizzBuzz(73));
        }
        public void FizzBuzzTest()
        {
            KataFizzBuzz thisKata = new KataFizzBuzz();

            Assert.AreEqual("", thisKata.FizzBuzz(-1));
            Assert.AreEqual("1", thisKata.FizzBuzz(1));
            Assert.AreEqual("Fizz", thisKata.FizzBuzz(3));
            Assert.AreEqual("Buzz", thisKata.FizzBuzz(5));
            Assert.AreEqual("FizzBuzz", thisKata.FizzBuzz(15));
            Assert.AreEqual("Fizz", thisKata.FizzBuzz(18));
            Assert.AreEqual("19", thisKata.FizzBuzz(19));
            Assert.AreEqual("FizzBuzz", thisKata.FizzBuzz(30));
            Assert.AreEqual("Buzz", thisKata.FizzBuzz(35));
            Assert.AreEqual("Fizz", thisKata.FizzBuzz(99));
            Assert.AreEqual("", thisKata.FizzBuzz(101));
        }
 public void NoFizzBuzzResultTests()
 {
     Assert.AreEqual("1", fizzBuzz.FizzBuzz(1), "WRONGWRONGWRONGWRONG");
     Assert.AreEqual("77", fizzBuzz.FizzBuzz(77), "Wrong");
     Assert.AreEqual("44", fizzBuzz.FizzBuzz(44), "Wrong");
 }
Exemplo n.º 23
0
 public void Fizz_Buzz_3()
 {
     Assert.AreEqual("Fizz", KataFizzBuzz.FizzBuzz(9));
     Assert.AreEqual("Fizz", KataFizzBuzz.FizzBuzz(12));
     Assert.AreEqual("Fizz", KataFizzBuzz.FizzBuzz(33));
 }
Exemplo n.º 24
0
 public void Fizz_Test() //test if multiple of 3 Fizz is printed
 {
     Assert.AreNotEqual("3", testFizzBuzz.FizzBuzz(3));
     Assert.AreEqual("Fizz", testFizzBuzz.FizzBuzz(3));
     Assert.AreEqual("Fizz", testFizzBuzz.FizzBuzz(51));
     Assert.AreNotEqual("Fizz", testFizzBuzz.FizzBuzz(15));
     Assert.AreEqual("", testFizzBuzz.FizzBuzz(0));
     Assert.AreEqual("", testFizzBuzz.FizzBuzz(101));
 }
Exemplo n.º 25
0
        public void FizzBuzz_ReturnsFizzBuzz_WhenDivisibleByThreeAndFive()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("FizzBuzz", kfb.FizzBuzz(360));
        }
Exemplo n.º 26
0
 public void OneCase()
 {
     Assert.AreEqual("1", testObject.FizzBuzz(1));
 }
Exemplo n.º 27
0
        public void FizzBuzz_ReturnFizz_WhenThee()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("Fizz", kfb.FizzBuzz(3));
        }
Exemplo n.º 28
0
        public void FizzBuzz_Seventeen_ReturnStringSeventeen()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("17", kfb.FizzBuzz(17));
        }
 public void NumberIsDivisibleByThree()
 {
     Assert.AreEqual("Fizz", testObject.FizzBuzz(3), "Test 1: Input was 3");
 }
Exemplo n.º 30
0
        public void FizzBuzz_ReturnBuzz_WhenContainsFive()
        {
            KataFizzBuzz kfb = new KataFizzBuzz();

            Assert.AreEqual("Buzz", kfb.FizzBuzz(55));
        }