Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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));
        }
Beispiel #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"));
        }