예제 #1
0
파일: Tests.cs 프로젝트: johankardell/Euler
 public void TestAllMultiplesOf3And5Below20Returns3_5_6_9_10_12_15_18()
 {
     _engine = new CalculatorEngine(20);
     var actual = _engine.GetMultiplesOf(3, 5);
     var expected = new List<int> { 3, 5, 6, 9, 10, 12, 15, 18 };
     CollectionAssert.AreEquivalent(expected, actual);
 }
예제 #2
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();
        }