Project files and Day01.
This commit is contained in:
20
AdventOfCode2020.Tests/AdventOfCode2020.Tests.csproj
Normal file
20
AdventOfCode2020.Tests/AdventOfCode2020.Tests.csproj
Normal file
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="1.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2020\AdventOfCode2020.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
50
AdventOfCode2020.Tests/Day01_Tests.cs
Normal file
50
AdventOfCode2020.Tests/Day01_Tests.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace AdventOfCode2020.Tests
|
||||
{
|
||||
[TestClass()]
|
||||
public class Day01_Tests
|
||||
{
|
||||
#region ResolvePart1
|
||||
|
||||
[TestMethod()]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
Day01 day01 = new Day01();
|
||||
|
||||
string result = day01.ResolvePart1(new string[] {
|
||||
"1721",
|
||||
"979",
|
||||
"366",
|
||||
"299",
|
||||
"675",
|
||||
"1456",
|
||||
});
|
||||
|
||||
Assert.AreEqual("514579", result);
|
||||
}
|
||||
|
||||
#endregion ResolvePart1
|
||||
|
||||
#region ResolvePart2
|
||||
|
||||
[TestMethod()]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
Day01 day01 = new Day01();
|
||||
|
||||
string result = day01.ResolvePart2(new string[] {
|
||||
"1721",
|
||||
"979",
|
||||
"366",
|
||||
"299",
|
||||
"675",
|
||||
"1456",
|
||||
});
|
||||
|
||||
Assert.AreEqual("241861950", result);
|
||||
}
|
||||
|
||||
#endregion ResolvePart2
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user