Code formatting and warning fixing.
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>AdventOfCode2020.Tests</RootNamespace>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>AdventOfCode2020.Tests</RootNamespace>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageReference Include="xunit" Version="2.6.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
|
||||
<PackageReference Include="xunit" Version="2.6.3"/>
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2020\AdventOfCode2020.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AdventOfCode2020\AdventOfCode2020.csproj"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -7,16 +7,16 @@ public class Day01_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day01();
|
||||
Day01 day = new Day01();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"1721",
|
||||
"979",
|
||||
"366",
|
||||
"299",
|
||||
"675",
|
||||
"1456",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("514579", result);
|
||||
}
|
||||
@@ -28,16 +28,16 @@ public class Day01_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day01();
|
||||
Day01 day = new Day01();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"1721",
|
||||
"979",
|
||||
"366",
|
||||
"299",
|
||||
"675",
|
||||
"1456",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("241861950", result);
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ public class Day02_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day02();
|
||||
Day02 day = new Day02();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"1-3 a: abcde",
|
||||
"1-3 b: cdefg",
|
||||
"2-9 c: ccccccccc",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("2", result);
|
||||
}
|
||||
@@ -25,13 +25,13 @@ public class Day02_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day02();
|
||||
Day02 day = new Day02();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"1-3 a: abcde",
|
||||
"1-3 b: cdefg",
|
||||
"2-9 c: ccccccccc",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("1", result);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ public class Day03_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day03();
|
||||
Day03 day = new Day03();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"..##.......",
|
||||
"#...#...#..",
|
||||
".#....#..#.",
|
||||
@@ -19,7 +19,7 @@ public class Day03_Tests
|
||||
"#.##...#...",
|
||||
"#...##....#",
|
||||
".#..#...#.#",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("7", result);
|
||||
}
|
||||
@@ -27,9 +27,9 @@ public class Day03_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day03();
|
||||
Day03 day = new Day03();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"..##.......",
|
||||
"#...#...#..",
|
||||
".#....#..#.",
|
||||
@@ -41,7 +41,7 @@ public class Day03_Tests
|
||||
"#.##...#...",
|
||||
"#...##....#",
|
||||
".#..#...#.#",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("336", result);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ public class Day04_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day04();
|
||||
Day04 day = new Day04();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"ecl:gry pid:860033327 eyr:2020 hcl:#fffffd",
|
||||
"byr:1937 iyr:2017 cid:147 hgt:183cm",
|
||||
"",
|
||||
@@ -21,7 +21,7 @@ public class Day04_Tests
|
||||
"",
|
||||
"hcl:#cfa07d eyr:2025 pid:166559648",
|
||||
"iyr:2011 ecl:brn hgt:59in",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("2", result);
|
||||
}
|
||||
@@ -29,9 +29,9 @@ public class Day04_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__ExampleInvalid()
|
||||
{
|
||||
var day = new Day04();
|
||||
Day04 day = new Day04();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"eyr:1972 cid:100",
|
||||
"hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926",
|
||||
"",
|
||||
@@ -45,7 +45,7 @@ public class Day04_Tests
|
||||
"hgt:59cm ecl:zzz",
|
||||
"eyr:2038 hcl:74454a iyr:2023",
|
||||
"pid:3556412378 byr:2007",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("0", result);
|
||||
}
|
||||
@@ -53,9 +53,9 @@ public class Day04_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__ExampleValid()
|
||||
{
|
||||
var day = new Day04();
|
||||
Day04 day = new Day04();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"pid:087499704 hgt:74in ecl:grn iyr:2012 eyr:2030 byr:1980",
|
||||
"hcl:#623a2f",
|
||||
"",
|
||||
@@ -68,7 +68,7 @@ public class Day04_Tests
|
||||
"eyr:2022",
|
||||
"",
|
||||
"iyr:2010 hgt:158cm hcl:#b6652a ecl:blu byr:1944 eyr:2021 pid:093154719",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("4", result);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ public class Day05_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example1()
|
||||
{
|
||||
var day = new Day05();
|
||||
Day05 day = new Day05();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"FBFBBFFRLR",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("357", result);
|
||||
}
|
||||
@@ -17,11 +17,11 @@ public class Day05_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example2()
|
||||
{
|
||||
var day = new Day05();
|
||||
Day05 day = new Day05();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"BFFFBBFRRR",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("567", result);
|
||||
}
|
||||
@@ -29,11 +29,11 @@ public class Day05_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example3()
|
||||
{
|
||||
var day = new Day05();
|
||||
Day05 day = new Day05();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"FFFBBBFRRR",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("119", result);
|
||||
}
|
||||
@@ -41,11 +41,11 @@ public class Day05_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example4()
|
||||
{
|
||||
var day = new Day05();
|
||||
Day05 day = new Day05();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"BBFFBBFRLL",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("820", result);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ public class Day06_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day06();
|
||||
Day06 day = new Day06();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"abc",
|
||||
"",
|
||||
"a",
|
||||
@@ -23,7 +23,7 @@ public class Day06_Tests
|
||||
"a",
|
||||
"",
|
||||
"b",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("11", result);
|
||||
}
|
||||
@@ -31,9 +31,9 @@ public class Day06_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day06();
|
||||
Day06 day = new Day06();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"abc",
|
||||
"",
|
||||
"a",
|
||||
@@ -49,7 +49,7 @@ public class Day06_Tests
|
||||
"a",
|
||||
"",
|
||||
"b",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("6", result);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ public class Day07_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day07();
|
||||
Day07 day = new Day07();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"light red bags contain 1 bright white bag, 2 muted yellow bags.",
|
||||
"dark orange bags contain 3 bright white bags, 4 muted yellow bags.",
|
||||
"bright white bags contain 1 shiny gold bag.",
|
||||
@@ -17,7 +17,7 @@ public class Day07_Tests
|
||||
"vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.",
|
||||
"faded blue bags contain no other bags.",
|
||||
"dotted black bags contain no other bags.",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("4", result);
|
||||
}
|
||||
@@ -25,9 +25,9 @@ public class Day07_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day07();
|
||||
Day07 day = new Day07();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"shiny gold bags contain 2 dark red bags.",
|
||||
"dark red bags contain 2 dark orange bags.",
|
||||
"dark orange bags contain 2 dark yellow bags.",
|
||||
@@ -35,7 +35,7 @@ public class Day07_Tests
|
||||
"dark green bags contain 2 dark blue bags.",
|
||||
"dark blue bags contain 2 dark violet bags.",
|
||||
"dark violet bags contain no other bags.",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("126", result);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ public class Day08_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day08();
|
||||
Day08 day = new Day08();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"nop +0",
|
||||
"acc +1",
|
||||
"jmp +4",
|
||||
@@ -17,7 +17,7 @@ public class Day08_Tests
|
||||
"acc +1",
|
||||
"jmp -4",
|
||||
"acc +6",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("5", result);
|
||||
}
|
||||
@@ -25,9 +25,9 @@ public class Day08_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day08();
|
||||
Day08 day = new Day08();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"nop +0",
|
||||
"acc +1",
|
||||
"jmp +4",
|
||||
@@ -37,7 +37,7 @@ public class Day08_Tests
|
||||
"acc +1",
|
||||
"jmp -4",
|
||||
"acc +6",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("8", result);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ public class Day09_Tests
|
||||
[Fact]
|
||||
public void ResolvePart1__Example()
|
||||
{
|
||||
var day = new Day09();
|
||||
Day09 day = new Day09();
|
||||
|
||||
string result = day.ResolvePart1(new[] {
|
||||
string result = day.ResolvePart1([
|
||||
"35",
|
||||
"20",
|
||||
"15",
|
||||
@@ -28,7 +28,7 @@ public class Day09_Tests
|
||||
"277",
|
||||
"309",
|
||||
"576",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("127", result);
|
||||
}
|
||||
@@ -36,9 +36,9 @@ public class Day09_Tests
|
||||
[Fact]
|
||||
public void ResolvePart2__Example()
|
||||
{
|
||||
var day = new Day09();
|
||||
Day09 day = new Day09();
|
||||
|
||||
string result = day.ResolvePart2(new[] {
|
||||
string result = day.ResolvePart2([
|
||||
"35",
|
||||
"20",
|
||||
"15",
|
||||
@@ -59,7 +59,7 @@ public class Day09_Tests
|
||||
"277",
|
||||
"309",
|
||||
"576",
|
||||
});
|
||||
]);
|
||||
|
||||
Assert.Equal("62", result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user