Initial Commit

This commit is contained in:
2016-08-13 18:20:14 -05:00
commit 50f4a86fd8
408 changed files with 15301 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# Sum Of Multiples
Write a program that, given a number, can find the sum of all the multiples of particular numbers up to but not including that number.
If we list all the natural numbers up to but not including 15 that are
multiples of either 3 or 5, we get 3, 5, 6 and 9, 10, and 12.
The sum of these multiples is 45.
Write a program that can find the sum of the multiples of a given set of
numbers.
## Source
A variation on Problem 1 at Project Euler [view source](http://projecteuler.net/problem=1)

View File

@@ -0,0 +1,32 @@
module SumOfMultiplesTest
open NUnit.Framework
open SumOfMultiples
[<TestFixture>]
type SumOfMultiplesTest() =
let mutable sumOfMultiples = SumOfMultiples()
[<Test>]
member tc.Sum_to_1() =
Assert.That(sumOfMultiples.To(0), Is.EqualTo(0))
[<Test>]
[<Ignore>]
member tc.Sum_to_3() =
Assert.That(sumOfMultiples.To(3), Is.EqualTo(0))
[<Test>]
[<Ignore>]
member tc.Sum_to_10() =
Assert.That(sumOfMultiples.To(10), Is.EqualTo(23))
[<Test>]
[<Ignore>]
member tc.Configurable_7_13_17_to_20() =
Assert.That(SumOfMultiples([7; 13; 17]).To(20), Is.EqualTo(51))
[<Test>]
[<Ignore>]
member tc.Configurable_43_47_to_10000() =
Assert.That(SumOfMultiples([43; 47]).To(10000), Is.EqualTo(2203160))