mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-04-21 06:03:57 +00:00
Initial commit
This commit is contained in:
parent
e523533d17
commit
10cceacca6
50 changed files with 1280 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
1
vscode/Chapter04/Ch04Ex02PrimeFactorsTests/Usings.cs
Normal file
1
vscode/Chapter04/Ch04Ex02PrimeFactorsTests/Usings.cs
Normal file
|
|
@ -0,0 +1 @@
|
|||
global using Xunit;
|
||||
Loading…
Add table
Add a link
Reference in a new issue