PrintFizzBuzz() публичный статический Метод

public static PrintFizzBuzz ( ) : string
Результат string
Пример #1
0
        public void CanTestSingleNumber(int number, string expectedresult)
        {
            var actualresult = FizzBuzz.PrintFizzBuzz(number);

            Assert.That(actualresult, Is.EqualTo(expectedresult),
                        string.Format("result of entered number [{0}] is [{1}] but it should be [{2}]", number,
                                      actualresult, expectedresult));
        }
Пример #2
0
        public void CanThrowArgumentExceptionWhenSuppliedNumberDoesNotMeetRule(int number)
        {
            var exception = Assert.Throws <ArgumentException>(() => FizzBuzz.PrintFizzBuzz(number));

            Assert.That(exception.Message, Is.EqualTo(string.Format("entered number is [{0}], which does not meet rule, entered number should be between 1 to 100.", number)));
        }
Пример #3
0
 public void CanTestFizz()
 {
     Console.WriteLine(FizzBuzz.PrintFizzBuzz());
     Assert.That(FizzBuzz.PrintFizzBuzz(), Is.EqualTo(_resultFizz));
 }