mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
36 lines
633 B
C#
36 lines
633 B
C#
using Ch04Ex02PrimeFactorsLib;
|
|
|
|
namespace Ch04Ex02PrimeFactorsTests
|
|
{
|
|
public class PrimeFactorsUnitTests
|
|
{
|
|
[Fact]
|
|
public void PrimeFactorsOf40()
|
|
{
|
|
// arrange
|
|
int number = 40;
|
|
string expected = "5 x 2 x 2 x 2";
|
|
|
|
// act
|
|
string actual = Primes.PrimeFactors(number);
|
|
|
|
// assert
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
|
|
[Fact]
|
|
public void PrimeFactorsOf99()
|
|
{
|
|
// arrange
|
|
int number = 99;
|
|
string expected = "11 x 3 x 3";
|
|
|
|
// act
|
|
string actual = Primes.PrimeFactors(number);
|
|
|
|
// assert
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
}
|
|
}
|