Ejemplo n.º 1
0
        public void when_number_is_times_of_3_and_5_return_FizzBuzz()
        {
            var printer = new CustomPrint();

            Assert.Equal("FizzBuzz", printer.GetValue(15));
            Assert.NotEqual("FizzBuzz", printer.GetValue(20));
        }
Ejemplo n.º 2
0
        public void when_number_is_times_of_5_return_Buzz()
        {
            var printer = new CustomPrint();

            Assert.Equal("Buzz", printer.GetValue(10));
            Assert.NotEqual("Buzz", printer.GetValue(9));
        }
Ejemplo n.º 3
0
        public void when_number_is_illegal_return_error()
        {
            var printer = new CustomPrint();

            Assert.Equal("error", printer.GetValue(0));
            Assert.Equal("error", printer.GetValue(-1));
            Assert.Equal("error", printer.GetValue(101));
        }
Ejemplo n.º 4
0
        public void when_number_is_not_times_of_3_or_5_return_number_itself()
        {
            var printer = new CustomPrint();
            var result  = printer.GetValue(7);

            Assert.Equal("7", result);
            Assert.False(result.Contains("Fizz") || result.Contains("Buzz"));
        }