ToString() публичный Метод

public ToString ( int number ) : string
number int
Результат string
Пример #1
0
        public void Pass2GetString2()
        {
            var fizzBuzz = new FizzBuzzer();
            var result = fizzBuzz.ToString(2);

            Assert.AreEqual("2", result);
        }
Пример #2
0
        public void PassDivisibleBy3GetFizz()
        {
            var fizzBuzz = new FizzBuzzer();
            var result = fizzBuzz.ToString(3);

            Assert.AreEqual("Fizz", result);
        }
Пример #3
0
        public void Pass1GetString1()
        {
            var fizzBuzz = new FizzBuzzer();
            var result = fizzBuzz.ToString(1);

            Assert.AreEqual("1", result);
        }
Пример #4
0
        public void PassDivisibleBy3And5And2GetFizzBuzzCoconut()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddSetting(2, "Coconut");
            var result = fizzBuzz.ToString(30);

            Assert.AreEqual("Fizz Buzz Coconut", result);
        }
Пример #5
0
        public void PassDivisibleBy7GetBanana()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(7, "Banana");
            var result = fizzBuzz.ToString(7);

            Assert.AreEqual("Banana", result);
        }
Пример #6
0
        public void PassDivisibleBy2GetCoconut()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(2, "Coconut");
            var result = fizzBuzz.ToString(2);

            Assert.AreEqual("Coconut", result);
        }
Пример #7
0
        public void PassDivisibleBy2And3And5And7GetCoconutFizzBuzzBanana()
        {
            var fizzBuzz = new FizzBuzzer();
            fizzBuzz.AddRule(2, "Coconut");
            fizzBuzz.AddRule(7, "Banana");
            var result = fizzBuzz.ToString(210);

            Assert.AreEqual("Coconut Fizz Buzz Banana", result);
        }