Exemplo n.º 1
0
 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);
 }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
 public void TestSumOfAllMultiplesOf3And5Below1000Returns233168()
 {
     _engine = new CalculatorEngine(1000);
     var actual = _engine.GetSumMultiplesOf(3, 5);
     Assert.AreEqual(233168, actual);
 }
Exemplo n.º 4
0
 public void Init()
 {
     _engine = new CalculatorEngine(10);
 }