-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEuler003.Test.cs
More file actions
31 lines (26 loc) · 656 Bytes
/
Euler003.Test.cs
File metadata and controls
31 lines (26 loc) · 656 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
namespace algorithm_exercises_csharp_test.hackerrank.projecteuler;
using algorithm_exercises_csharp.hackerrank.projecteuler;
[TestClass]
public class Euler003Test
{
public class Euler003TestCase
{
public int N { get; set; }
public int? Answer { get; set; }
}
private static readonly Euler003TestCase[] tests = [
new() { N = 1, Answer = null },
new() { N = 10, Answer = 5 },
new() { N = 17, Answer = 17 }
];
[TestMethod]
public void euler003Test()
{
int? result;
foreach (Euler003TestCase test in tests)
{
result = Euler003.euler003(test.N);
Assert.AreEqual(test.Answer, result);
}
}
}