AdventOfCode 2023 Day01
This commit is contained in:
28
AdventOfCode2023.Tests/AdventOfCode2023.Tests.csproj
Normal file
28
AdventOfCode2023.Tests/AdventOfCode2023.Tests.csproj
Normal 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.3.2"/>
|
||||
<PackageReference Include="xunit" Version="2.4.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2023\AdventOfCode2023.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
37
AdventOfCode2023.Tests/Day01_Tests.cs
Normal file
37
AdventOfCode2023.Tests/Day01_Tests.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
namespace AdventOfCode2023.Tests;
|
||||
|
||||
public class Day01_Tests
|
||||
{
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day01();
|
||||
|
||||
string result = day.ResolvePart1(new string[] {
|
||||
"1abc2",
|
||||
"pqr3stu8vwx",
|
||||
"a1b2c3d4e5f",
|
||||
"treb7uchet",
|
||||
});
|
||||
|
||||
Assert.Equal("142", result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day01();
|
||||
|
||||
string result = day.ResolvePart2(new string[] {
|
||||
"two1nine",
|
||||
"eightwothree",
|
||||
"abcone2threexyz",
|
||||
"xtwone3four",
|
||||
"4nineeightseven2",
|
||||
"zoneight234",
|
||||
"7pqrstsixteen",
|
||||
});
|
||||
|
||||
Assert.Equal("281", result);
|
||||
}
|
||||
}
|
||||
1
AdventOfCode2023.Tests/Usings.cs
Normal file
1
AdventOfCode2023.Tests/Usings.cs
Normal file
@@ -0,0 +1 @@
|
||||
global using Xunit;
|
||||
Reference in New Issue
Block a user