public void NoFactors() { int upperBound = 10; List <int> factor = new List <int>(); int expected = 0; int actual = Adder.SumOfNumbersBelowDivisibleByAnyFactor(upperBound, factor); Assert.AreEqual(expected, actual); }
public void SumOfNumbersBelowFifteenDivisibleByThreeOrFive() { int upperBound = 10; List <int> factors = new List <int> { 3, 5 }; int expected = 23; int actual = Adder.SumOfNumbersBelowDivisibleByAnyFactor(upperBound, factors); Assert.AreEqual(expected, actual); }
static void Main(string[] args) { int upperBound = 1000; List <int> factors = new List <int> { 3, 5 }; int sum = Adder.SumOfNumbersBelowDivisibleByAnyFactor(upperBound, factors); Console.WriteLine("Sum: " + sum); Console.ReadKey(); }