Initial commit

This commit is contained in:
Mark J Price 2022-02-19 19:56:52 +00:00
parent e523533d17
commit 10cceacca6
50 changed files with 1280 additions and 0 deletions

View file

@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ch04Ex02PrimeFactorsLib\Ch04Ex02PrimeFactorsLib.csproj" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,35 @@
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);
}
}
}

View file

@ -0,0 +1 @@
global using Xunit;