Example #1
0
        static void Main(string[] args)
        {
            Console.Write("Enter maximum number: ");
            var max = Console.ReadLine();

            var engine = new CalculatorEngine(int.Parse(max));
            var multiples = engine.GetMultiplesOf(3, 5);
            var sum = engine.GetSumMultiplesOf(3, 5);

            Console.WriteLine("Numbers: ");
            multiples.ForEach(Console.WriteLine);

            Console.WriteLine();
            Console.WriteLine("Sum: " + sum.ToString());

            Console.ReadKey();
        }
Example #2
0
 public void TestSumOfAllMultiplesOf3And5Below1000Returns233168()
 {
     _engine = new CalculatorEngine(1000);
     var actual = _engine.GetSumMultiplesOf(3, 5);
     Assert.AreEqual(233168, actual);
 }