chore(*): Update syntax for newer version of NUnit

This commit is contained in:
Josh Creek
2024-11-28 22:56:28 +00:00
parent 84b90ee274
commit 4c7a90778a
19 changed files with 51 additions and 51 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ namespace AOC.Tests.Y2015
[TestCase(")))", -3)] // Example data
[TestCase(")())())", -3)] // Example data
[TestCase(null, 232)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
var lines = input != null ? input : realData;
@@ -45,7 +45,7 @@ namespace AOC.Tests.Y2015
[TestCase(")", 1)] // Example data
[TestCase("()())", 5)]
[TestCase(null, 1783)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
var lines = input != null ? input : realData;
@@ -79,4 +79,4 @@ namespace AOC.Tests.Y2015
Console.WriteLine($"Part 2: {result}");
}
}
}
}
+3 -3
View File
@@ -18,7 +18,7 @@ namespace AOC.Tests.Y2015
[TestCase("2x3x4", 58)]
[TestCase("1x1x10", 43)]
[TestCase(null, 1606483)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
string[] lines = input != null ? new[] { input } : realData;
@@ -53,7 +53,7 @@ namespace AOC.Tests.Y2015
[TestCase("2x3x4", 34)]
[TestCase("1x1x10", 14)]
[TestCase(null, 3842356)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
string[] lines = input != null ? new[] { input } : realData;
@@ -86,4 +86,4 @@ namespace AOC.Tests.Y2015
Console.WriteLine($"Part 2: {totalRibbon}");
}
}
}
}
+3 -3
View File
@@ -47,7 +47,7 @@ namespace AOC.Tests.Y2015
[TestCase("^>v<", 4)]
[TestCase("^v^v^v^v^v", 2)]
[TestCase(null, 2565)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
string lines = input != null ? input : realData;
int currentX = 0;
@@ -102,7 +102,7 @@ namespace AOC.Tests.Y2015
[TestCase("^>v<", 3)]
[TestCase("^v^v^v^v^v", 11)]
[TestCase(null, 2639)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
string lines = input != null ? input : realData;
int currentX = 0;
@@ -194,4 +194,4 @@ namespace AOC.Tests.Y2015
Console.WriteLine($"Part 2: {numberOfHousesVisited}");
}
}
}
}
+3 -3
View File
@@ -46,7 +46,7 @@ namespace AOC.Tests.Y2015
[TestCase("abcdef", 609043)]
[TestCase("pqrstuv", 1048970)]
[TestCase(null, 254575)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
string lines = input != null ? input : realData;
@@ -61,7 +61,7 @@ namespace AOC.Tests.Y2015
}
[TestCase(null, 1038736)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
string lines = input != null ? input : realData;
@@ -75,4 +75,4 @@ namespace AOC.Tests.Y2015
Console.WriteLine($"Part 2: {i}");
}
}
}
}
+3 -3
View File
@@ -139,7 +139,7 @@ namespace AOC.Tests.Y2015
[TestCase("haegwjzuvuyypxyu", 0)]
[TestCase("dvszwmarrgswjxmb", 0)]
[TestCase(null, 258)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
string[] lines = input != null ? new[] { input } : realData;
@@ -166,7 +166,7 @@ namespace AOC.Tests.Y2015
[TestCase("uurcxstgmygtbstg", 0)]
[TestCase("ieodomkazucvgmuy", 0)]
[TestCase(null, 53)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
string[] lines = input != null ? new[] { input } : realData;
@@ -188,4 +188,4 @@ namespace AOC.Tests.Y2015
Console.WriteLine($"Part 2: {niceCount}");
}
}
}
}
+3 -3
View File
@@ -93,7 +93,7 @@ namespace AOC.Tests.Y2015
[TestCase("toggle 0,0 through 999,0", 1000)]
[TestCase("turn on 0,0 through 999,999/nturn off 499,499 through 500,500", 999996)]
[TestCase(null, 400410)] // 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;
@@ -121,7 +121,7 @@ namespace AOC.Tests.Y2015
[TestCase("turn on 0,0 through 0,0", 1)]
[TestCase("toggle 0,0 through 999,999", 2000000)]
[TestCase(null, 15343601)] // 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;
@@ -142,4 +142,4 @@ namespace AOC.Tests.Y2015
Console.WriteLine($"Part 2: {totalBrightness}");
}
}
}
}
+3 -3
View File
@@ -16,7 +16,7 @@ namespace AOC.Tests.Y2021
[TestCase("199,200,208,210,200,207,240,269,260,263", 7)] // Example data
[TestCase(null, 1681)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
var lines = input != null ? input.Split(',') : realData;
@@ -46,7 +46,7 @@ namespace AOC.Tests.Y2021
[TestCase("199,200,208,210,200,207,240,269,260,263", 5)] // Example data
[TestCase(null, 1704)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
var lines = input != null ? input.Split(',') : realData;
@@ -84,4 +84,4 @@ namespace AOC.Tests.Y2021
Console.WriteLine($"Part 2: {numberOfBiggerSlidingTotals}");
}
}
}
}
+3 -3
View File
@@ -29,7 +29,7 @@ namespace AOC.Tests.Y2022
10000", 24000)]
[TestCase(null, 70764)] // 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;
@@ -75,7 +75,7 @@ namespace AOC.Tests.Y2022
10000", 45000)]
[TestCase(null, 203905)] // 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;
@@ -107,4 +107,4 @@ namespace AOC.Tests.Y2022
Console.WriteLine($"Part 2: {result}");
}
}
}
}
+3 -3
View File
@@ -18,7 +18,7 @@ namespace AOC.Tests.Y2022
B X
C Z", 15)]
[TestCase(null, 8392)] // 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;
@@ -36,7 +36,7 @@ C Z", 15)]
B X
C Z", 12)]
[TestCase(null, 1783)] // 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;
@@ -174,4 +174,4 @@ C Z", 12)]
}
}
}
}
}
+3 -3
View File
@@ -76,7 +76,7 @@ wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
ttgJtRGJQctTZtZT
CrZsJsPPZsGzwwsLwLmpwMDw", 157)]
[TestCase(null, 8176)] // 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;
List<char> items = new();
@@ -112,7 +112,7 @@ wMqvLMZHhHMvwLHjbvcjnnSBnvTQFn
ttgJtRGJQctTZtZT
CrZsJsPPZsGzwwsLwLmpwMDw", 70)]
[TestCase(null, 2689)] // 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;
List<char> items = new();
@@ -141,4 +141,4 @@ CrZsJsPPZsGzwwsLwLmpwMDw", 70)]
Console.WriteLine($"Part 2: {result}");
}
}
}
}
+3 -3
View File
@@ -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;
}
}
}
}
+3 -3
View File
@@ -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}");
}
}
}
}
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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();
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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;
+3 -3
View File
@@ -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(() =>
{
+2 -2
View File
@@ -16,7 +16,7 @@ public class DayX
[TestCase("blah", 0)]
[TestCase(null, 232)] // The actual answer
public void Part1(string input, int? expected)
public void Part1(string? input, int? expected)
{
string[] lines = input != null ? new[] { input } : realData;
// string[] lines = input != null ? input.Split("\n") : realData;
@@ -31,7 +31,7 @@ public class DayX
[TestCase("blah", 1)]
[TestCase(null, 1783)] // The actual answer
public void Part2(string input, int? expected)
public void Part2(string? input, int? expected)
{
//string[] lines = input != null ? new[] { input } : realData;
// string[] lines = input != null ? input.Split("\n") : realData;