Пример #1
0
        public void WeReachedMaxLoop()
        {
            int maxValue = 30;
            GetRange range = new GetRange();

            var input = new RunArgs(15, maxValue, "Fizz", "Buzz");
            range.Run(input);

            Assert.IsTrue(range.LoopedTo == maxValue);
        }
Пример #2
0
        static void Main(string[] args)
        {
            GetRange range = new GetRange();
            range.ShowOutput += (s, e) =>
            {
                Console.WriteLine(e);
            };

            var input = new RunArgs(0, 150, "Fizz", "Buzz");
            range.Run(input);

            // OR
            //range.Run(1, 100, "Fizz", "Buzz");

            Console.ReadLine();
        }
Пример #3
0
        public void ZeroCheck()
        {
            // 0 is NOT DivisableBy 3,5 and 15 but the C# % operator handles 0 % n, and always returns 0, so need to test that we've handled this case in our code.
            int minValue = 0;
            int maxValue = 1;
            int i = minValue;

            GetRange range = new GetRange();
            range.ShowOutput += (s, e) =>
            {
                if (i == 0)
                    Assert.AreEqual(i.ToString(), e);
                i++;
            };

            var input = new RunArgs(minValue, maxValue, "Fizz", "Buzz");
            range.Run(input);
        }
Пример #4
0
 public void Run(RunArgs args)
 {
     ExecuteRun(args.LowRange, args.HighRange, args.Value1, args.Value2);
 }