Add AoC 2026 project templates
This commit is contained in:
1 parent
5e3bb81140
commit
132f8db999
7 files changed
+220
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2"/>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
|
||||
<PackageReference Include="xunit" Version="2.9.2"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Xunit"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AoC_2026\AoC_2026.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,47 @@
|
||||
using AdvenOfCode.Contracts;
|
||||
|
||||
namespace AoC_2026.Tests;
|
||||
|
||||
public class Day01Test
|
||||
{
|
||||
private readonly IPuzzleSolver<int> _sut;
|
||||
private static readonly string rootPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||
private readonly string TestInputPath = @$"{rootPath}/AoC-PuzzleInputs/2026/Test/day01.txt";
|
||||
private readonly string ProdInputPath = @$"{rootPath}/AoC-PuzzleInputs/2026/Prod/day01.txt";
|
||||
|
||||
public Day01Test()
|
||||
{
|
||||
_sut = new Day01();
|
||||
}
|
||||
[Fact]
|
||||
public void Part01_Test_equals_3()
|
||||
{
|
||||
var actual = _sut.SolvePart1(TestInputPath);
|
||||
|
||||
Assert.Equal(3, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Part01_Prod_equals_1097()
|
||||
{
|
||||
var actual = _sut.SolvePart1(ProdInputPath);
|
||||
|
||||
Assert.Equal(1097, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Part02_Test_equals_16()
|
||||
{
|
||||
var actual = _sut.SolvePart2(TestInputPath);
|
||||
|
||||
Assert.Equal(16, actual);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Part02_Prod_equals_7101()
|
||||
{
|
||||
var actual = _sut.SolvePart2(ProdInputPath);
|
||||
|
||||
Assert.Equal(7101, actual);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user