-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEuler001.Test.cs
More file actions
34 lines (28 loc) · 784 Bytes
/
Euler001.Test.cs
File metadata and controls
34 lines (28 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace algorithm_exercises_csharp_test.hackerrank.projecteuler;
using algorithm_exercises_csharp.hackerrank.projecteuler;
[TestClass]
public class Euler001Test
{
public class Euler001TestCase
{
public int A { get; set; }
public int B { get; set; }
public int N { get; set; }
public int Answer { get; set; }
}
private static readonly Euler001TestCase[] tests = [
new() { A = 3, B = 5, N = 10, Answer = 23 },
new() { A = 3, B = 5, N = 100, Answer = 2318 },
new() { A = 3, B = 5, N = 1000, Answer = 233168 }
];
[TestMethod]
public void euler001Test()
{
int result;
foreach (Euler001TestCase test in tests)
{
result = Euler001.euler001(test.A, test.B, test.N);
Assert.AreEqual(test.Answer, result);
}
}
}