Ejemplo n.º 1
0
        public void TestVariableCustomerData()
        {
            //arrange
            var ergebnis = "151 152 fizz 154 buzz fizz 157 158 fizz buzz 161 fizz 163 164 fizzbuzz 166 167 fizz 169 buzz fizz 172 173 fizz buzz 176 fizz 178 179 fizzbuzz".Split(' ');

            //act
            FizzBuzz fizzBuzz = new FizzBuzz();
            var result = fizzBuzz.GetList(new FizzBuzz.FizzBuzzParameters(151, 180, 3, 5));

            //assert
            Assert.IsTrue(result.SequenceEqual(ergebnis));
        }
Ejemplo n.º 2
0
        public void TestVariablesFizzBuzz()
        {
            //Arr
            var ergebnis ="1 2 3 4 fizz 6 buzz 8 9 fizz 11 12 13 buzz fizz 16 17 18 19 fizz buzz 22 23 24 fizz 26 27 buzz 29 fizz 31 32 33 34 fizzbuzz 36 37 38 39 fizz 41 buzz 43 44 fizz 46 47 48 buzz fizz 51 52 53 54 fizz buzz 57 58 59 fizz 61 62 buzz 64 fizz 66 67 68 69 fizzbuzz 71 72 73 74 fizz 76 buzz 78 79 fizz 81 82 83 buzz fizz 86 87 88 89 fizz buzz 92 93 94 fizz 96 97 buzz 99 fizz".Split(' ');

            //act
            FizzBuzz fizzBuzz = new FizzBuzz();
            var result = fizzBuzz.GetList(new FizzBuzz.FizzBuzzParameters(1, 100, 5, 7));

            //assert
            Assert.IsTrue(result.SequenceEqual(ergebnis));
        }
Ejemplo n.º 3
0
        public void TestFIzzBuzz100()
        {
            //arrange
            var ergebnis = "1 2 fizz 4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz fizz 22 23 fizz buzz 26 fizz 28 29 fizzbuzz 31 32 fizz 34 buzz fizz 37 38 fizz buzz 41 fizz 43 44 fizzbuzz 46 47 fizz 49 buzz fizz 52 53 fizz buzz 56 fizz 58 59 fizzbuzz 61 62 fizz 64 buzz fizz 67 68 fizz buzz 71 fizz 73 74 fizzbuzz 76 77 fizz 79 buzz fizz 82 83 fizz buzz 86 fizz 88 89 fizzbuzz 91 92 fizz 94 buzz fizz 97 98 fizz buzz".Split(' ');

            //act
            FizzBuzz fizzBuzz = new FizzBuzz();
            var result = fizzBuzz.GetList(new FizzBuzz.FizzBuzzParameters(1, 100, 3, 5));

            //assert
            Assert.IsTrue(result.SequenceEqual(ergebnis));
        }
Ejemplo n.º 4
0
        public void TestVariableBoundaries()
        {
            //arrange
            var ergebnis = "4 buzz fizz 7 8 fizz buzz 11 fizz 13 14 fizzbuzz 16 17 fizz 19 buzz".Split(' ');

            //act
            FizzBuzz fizzBuzz = new FizzBuzz();
            var result = fizzBuzz.GetList(new FizzBuzz.FizzBuzzParameters(4, 20, 3, 5));

            //assert
            Assert.IsTrue(result.SequenceEqual(ergebnis));
        }
Ejemplo n.º 5
0
 public void NonNegativeValue()
 {
     Assert.IsTrue(FizzBuzz.CalcFizzBuzz("-1").ToString().Equals("Valeur invalide"));
 }
Ejemplo n.º 6
0
        public void TestFIzzBuzz()
        {
            //arrange
            var ergebnis = new List<string>
                               {
                                                                      "1",
                                   "2",
                                   "fizz",
                                   "4",
                                   "buzz",
                                   "fizz",
                                   "7",
                                   "8",
                                   "fizz",
                                   "buzz",
                                   "11",
                                   "fizz",
                                   "13",
                                   "14",
                                   "fizzbuzz"
                               };
            //act
            FizzBuzz fizzBuzz = new FizzBuzz();
            var result = fizzBuzz.GetList(new FizzBuzz.FizzBuzzParameters(1, 15, 3, 5));

            //assert
            Assert.IsTrue(result.SequenceEqual(ergebnis));
        }
Ejemplo n.º 7
0
 public void NumericValue()
 {
     Assert.IsTrue(FizzBuzz.CalcFizzBuzz("Hello").ToString().Equals("Valeur invalide"));
 }
Ejemplo n.º 8
0
 public void ValidatePrintRange()
 {
     Assert.Equal(ExpectedOutputOfRange_1_to_30, FizzBuzz.Print(1, 30, FizzBuzz.DefaultTranslations));
 }
Ejemplo n.º 9
0
 public void ValidatePrint(int input, string expectedOutput)
 {
     Assert.Equal(expectedOutput, FizzBuzz.Print(input, FizzBuzz.DefaultTranslations));
 }
Ejemplo n.º 10
0
        public void Should_Return_stringEmpty_when_number_is_not_Divisible_by_3_and_5()
        {
            string result = FizzBuzz.GetAnswserFor(0);

            Assert.AreEqual(result, string.Empty);
        }
Ejemplo n.º 11
0
        public void Should_Return_FizzBuzz_when_number_is_Divisible_by_3_and_5()
        {
            string result = FizzBuzz.GetAnswserFor(15);

            Assert.AreEqual(result, "FizzBuzz");
        }