Ejemplo n.º 1
0
        public void can_handle_enumerable_sequence()
        {
            var fizzer = new FizzBuzzOmatic();

            fizzer.Add(3, "Fizz")
            .Add(5, "Buzz");

            var results = fizzer.ProduceSequence(Enumerable.Range(1, 5));

            var expected = new[]
            {
                "1", "2", "Fizz", "4", "Buzz"
            };

            Assert.Equal(expected, results);
        }
Ejemplo n.º 2
0
        public void can_handle_arbitrary_indices()
        {
            var fizzer = new FizzBuzzOmatic();

            fizzer.Add(3, "Fizz")
            .Add(5, "Buzz");

            var results = fizzer.ProduceSequence(3, 5, 15, 1, 2);

            var expected = new[]
            {
                "Fizz", "Buzz", "FizzBuzz", "1", "2"
            };

            Assert.Equal(expected, results);
        }