コード例 #1
0
        public void Return_String_Representation_Of_Input_Int(int number)
        {
            var factory  = new UpdateStrategyFactory();
            var strategy = factory.Create(number);

            var conversionService = new NumberConversionService(strategy);
            var output            = conversionService.Convert();

            Assert.AreEqual(number.ToString(), output);
        }
コード例 #2
0
        public void Return_FizzBuzz_For_Number_Divisible_By_Three_And_Five(int number)
        {
            var factory  = new UpdateStrategyFactory();
            var strategy = factory.Create(number);

            var conversionService = new NumberConversionService(strategy);
            var output            = conversionService.Convert();

            Assert.AreEqual("FizzBuzz", output);
        }
コード例 #3
0
        static void Main(string[] args)
        {
            for (int i = 1; i < 101; i++)
            {
                var factory  = new UpdateStrategyFactory();
                var strategy = factory.Create(i);

                var conversionService = new NumberConversionService(strategy);
                var output            = conversionService.Convert();

                Console.WriteLine(i);
            }
        }