mirror of
https://github.com/jcreek/advent-of-code.git
synced 2026-07-14 03:33:45 +00:00
chore(*): Update syntax for newer version of NUnit
This commit is contained in:
@@ -21,7 +21,7 @@ pqr3stu8vwx
|
||||
a1b2c3d4e5f
|
||||
treb7uchet", 142)]
|
||||
[TestCase(null, 53080)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -60,7 +60,7 @@ zoneight234
|
||||
[TestCase("three2six8two5", 35)]
|
||||
[TestCase("eightjzqzhrllg1oneightfck", 88)]
|
||||
[TestCase(null, 53268)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -153,4 +153,4 @@ zoneight234
|
||||
return finalNumber;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
||||
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
||||
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green", 8)]
|
||||
[TestCase(null, 1734)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -105,7 +105,7 @@ Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
||||
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
||||
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green", 2286)]
|
||||
[TestCase(null, 70387)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -175,4 +175,4 @@ Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green", 2286)]
|
||||
Console.WriteLine($"Part 2: {result}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ public class Day03
|
||||
...$.*....
|
||||
.664.598..", 4361)]
|
||||
[TestCase(null, 550934)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -419,7 +419,7 @@ public class Day03
|
||||
...$.*....
|
||||
.664.598..", 467835)]
|
||||
[TestCase(null, 81997870)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
|
||||
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
|
||||
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11", 13)]
|
||||
[TestCase(null, 17782)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -88,7 +88,7 @@ Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83
|
||||
Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36
|
||||
Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11", 30)]
|
||||
[TestCase(null, 8477787)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ humidity-to-location map:
|
||||
60 56 37
|
||||
56 93 4", 35)]
|
||||
[TestCase(null, 265018614)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
Almanac almanac = new();
|
||||
@@ -191,7 +191,7 @@ humidity-to-location map:
|
||||
60 56 37
|
||||
56 93 4", 46)]
|
||||
[TestCase(null, 63179500)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
Almanac almanac = new();
|
||||
|
||||
@@ -17,7 +17,7 @@ public class Day06
|
||||
[TestCase(@"Time: 7 15 30
|
||||
Distance: 9 40 200", 288)]
|
||||
[TestCase(null, 1660968)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -82,7 +82,7 @@ Distance: 9 40 200", 288)]
|
||||
[TestCase(@"Time: 7 15 30
|
||||
Distance: 9 40 200", 71503)]
|
||||
[TestCase(null, 26499773)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ KK677 28
|
||||
KTJJT 220
|
||||
QQQJA 483", 6440)]
|
||||
[TestCase(null, 247815719)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -86,7 +86,7 @@ AAAAA 61
|
||||
2JJJJ 53
|
||||
JJJJ2 41", 6839)]
|
||||
[TestCase(null, 248747492)] // The actual answer
|
||||
public void Part2(string input, int? expected)
|
||||
public void Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ AAA = (BBB, BBB)
|
||||
BBB = (AAA, ZZZ)
|
||||
ZZZ = (ZZZ, ZZZ)", 6)]
|
||||
[TestCase(null, 19199)] // The actual answer
|
||||
public void Part1(string input, int? expected)
|
||||
public void Part1(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -89,7 +89,7 @@ ZZZ = (ZZZ, ZZZ)", 6)]
|
||||
22Z = (22B, 22B)
|
||||
XXX = (XXX, XXX)", 6)]
|
||||
[TestCase(null, 1783)] // The actual answer
|
||||
public async Task Part2(string input, int? expected)
|
||||
public async Task Part2(string? input, int? expected)
|
||||
{
|
||||
string[] lines = input != null ? input.Split("\n") : realData;
|
||||
|
||||
@@ -122,7 +122,7 @@ XXX = (XXX, XXX)", 6)]
|
||||
// For each location, follow the instruction
|
||||
for (int i = 0; i < currentLocations.Count; i++)
|
||||
{
|
||||
int localI = i; // Local copy of the loop variable
|
||||
int localI = i; // Local copy of the loop variable
|
||||
char instruction = instructions[instructionIndex];
|
||||
tasks[localI] = Task.Factory.StartNew(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user