-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPFLibUnitTests
60 lines (56 loc) · 1.58 KB
/
PFLibUnitTests
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using Ch04Ex02PrimeFactorsLib;
using static System.Console;
namespace PrimeFactorsLibUnitTests
{
public class PFLibUnitTests
{
[Fact]
public void testInputisaprimenumber()
{
//arrange
double a = 97;
List<string> expected = new List<string> { "97" };
PFLib thePFs = new();
//act
List<string> actual = thePFs.primeFactors(a);
//assert
Assert.Equal(expected, actual);
}
[Fact]
public void testInputhasonepf()
{
//arrange
double a = 4;
List<string> expected = new List<string> { "2" };
PFLib thePFs = new();
//act
List<string> actual = thePFs.primeFactors(a);
//assert
Assert.Equal(expected, actual);
}
[Fact]
public void testInputhastwopf()
{
//arrange
double a = 10;
List<string> expected = new List<string> { "2", "5" };
PFLib thePFs = new();
//act
List<string> actual = thePFs.primeFactors(a);
//assert
Assert.Equal(expected, actual);
}
[Fact]
public void testInputhasthreeormorepf()
{
//arrange
double a = 110;
List<string> expected = new List<string> { "2", "5", "11" };
PFLib thePFs = new();
//act
List<string> actual = thePFs.primeFactors(a);
//assert
Assert.Equal(expected, actual);
}
}
}