public void Y2021_Day03_GetLifeSupportRating_Returns_Correct_Value() { // Arrange string[] diagnosticReport = { "00100", "11110", "10110", "10111", "10101", "01111", "00111", "11100", "10000", "11001", "00010", "01010", }; // Act int actual = Day03.GetLifeSupportRating(diagnosticReport); // Assert actual.ShouldBe(230); }
public void Day03_Part2_Examples() { var d = new Day03(); Assert.AreEqual(3, d.SolutionPart2("^v")); Assert.AreEqual(11, d.SolutionPart2("^v^v^v^v^v")); }
public void Day03() { var d = new Day03(); Assert.AreEqual(216, d.SimpleTreeCount()); Assert.AreEqual(6708199680, d.TreeCountProduct()); }
public void Y2021_Day03_GetPowerConsumption_Returns_Correct_Value() { // Arrange string[] diagnosticReport = { "00100", "11110", "10110", "10111", "10101", "01111", "00111", "11100", "10000", "11001", "00010", "01010", }; // Act int actual = Day03.GetPowerConsumption(diagnosticReport); // Assert actual.ShouldBe(198); }
public void TestTreesHit() { IList <string> rawInput = new List <string> { "..##.......", "#...#...#..", ".#....#..#.", "..#.#...#.#", ".#...##..#.", "..#.##.....", ".#.#.#....#", ".#........#", "#.##...#...", "#...##....#", ".#..#...#.#" }; IList <IList <bool> > input = Helpers.ApplyTransformation(rawInput, Day03.GetTreeIndices); const int dx = 3; const int dy = 1; const long expected = 7; long actual = Day03.GetTreesHit(input, dx, dy); Assert.AreEqual(expected, actual, "Number of trees hit does not equal expected."); }
public void Task1() { Assert.AreEqual(0, Day03.Task1(1)); Assert.AreEqual(3, Day03.Task1(12)); Assert.AreEqual(2, Day03.Task1(23)); Assert.AreEqual(31, Day03.Task1(1024)); }
public void GetDay3Part2AnswerTest() { int expected = 20286; int actual = Day03.GetDay3Part2Answer(); Assert.Equal(expected, actual); }
public void ShouldGetCorrectNumberOfConflicts() { const int fabricSize = 1000; var result = Day03.GetNumberOfConflictsAndRemainingCleanClaims(path, fabricSize); Assert.AreEqual(104126, result.Item1); }
public void Day03(int part1, int part2) { var d = new Day03(); Assert.Equal(part1.ToString(), d.Part1()); Assert.Equal(part2.ToString(), d.Part2()); }
public void Part2(string w1, string w2, int expected) { var solver = new Day03(); var result = solver.Solve2(w1, w2); result.ShouldBe(expected); }
public void RoboWalkThroughHouses(string directions, int expectedHouseCount) { var d03 = new Day03(); var houseCount = d03.CountHousesWithPresent(directions, 2); Assert.That(houseCount, Is.EqualTo(expectedHouseCount)); }
public void Day03() { var day = new Day03(289326); Assert.Equal(419, day.FirstPart()); Assert.Equal(289326, day.SecondPart()); }
public void ExampleA1() { Assert.AreEqual(0, Day03.ValidTriangles( new HorizontalParser(new List <string> { "5 10 25" }))); }
public void GetDay03Part02AnswerTest() { int expected = 1206576000; int actual = Day03.GetDay03Part02Answer(); Assert.Equal(expected, actual); }
public void GetDay03Part01AnswerTest() { int expected = 171; int actual = Day03.GetDay03Part01Answer(); Assert.Equal(expected, actual); }
public void Part2Solution() { var lines = InputDataHelper.GetLines(3); var solver = new Day03(); var result = solver.Solve2(lines[0], lines[1]); _testOutputHelper.WriteLine(result.ToString()); }
public void Solve2() { var map = DataHelper.GetAllRows(3); var solver = new Day03(); var result = solver.Solve2(map); Output.WriteLine(result.ToString()); }
public void Part2_TestOne() { var lines = new List <string> { "#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2" }; Assert.AreEqual(3, Day03.GetResult(lines).NonOverlappingClaimId); }
public void Part1_TestOne() { var lines = new List <string> { "#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2" }; Assert.AreEqual(4, Day03.GetResult(lines).OverlappingCount); }
public void Part2() { var expected = 230; var day = new Day03(); var actual = day.Part2(_input); Assert.Equal(expected, actual); }
public void NumberOfSteps_Test(string[] line1, string[] line2, int expected) { // Act var actual = Day03.NumberOfSteps(line1, line2); // Assert Assert.Equal(expected, actual); }
public void Test03(int x, int y, int expected) { var lines = data.Lines().ToList(); var slope = new Tuple <int, int>(x, y); var result = Day03.TreesEncountered(lines, slope); Assert.Equal(expected, result); }
public void Part02(int input, int expected) { // Act int actual = Day03.Part02(input); // Assert Assert.Equal(expected, actual); }
public void Day03Part02() { var day03 = new Day03(); day03.Part02("1").Should().Be("2"); day03.Part02("58").Should().Be("59"); day03.Part02("59").Should().Be("122"); }
public void TestPart2() { string[] input = new string[] { "#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2" }; Day03 day03 = new Day03(); Assert.Equal(3, day03.Part2(day03.ParseClaims(input))); }
public void Day03_Part1_Examples() { var d = new Day03(); Assert.AreEqual(2, d.SolutionPart1(">")); Assert.AreEqual(4, d.SolutionPart1("^>v<")); Assert.AreEqual(2, d.SolutionPart1("^v^v^v^v^v")); }
public static void Y2016_Day03_IsTriangleValid_Returns_Correct_Solution(int a, int b, int c, bool expected) { // Act bool actual = Day03.IsValidTriangle(a, b, c); // Assert actual.ShouldBe(expected); }
public void DrawLine_Test(string[] line1, string[] line2, int expected) { // Act var actual = Day03.Distance(line1, line2); // Assert Assert.Equal(expected, actual); }
public void ShouldGetTheOnlyConflictFreeId() { const int fabricSize = 1000; var result = Day03.GetNumberOfConflictsAndRemainingCleanClaims(path, fabricSize); Assert.AreEqual(1, result.Item2.Count); Assert.AreEqual("695", result.Item2.First()); }
public void Day03_Extra(string code, int part1, int part2) { var d = new Day03(); d.OverrideInput(code); Assert.Equal(part1.ToString(), d.Part1()); Assert.Equal(part2.ToString(), d.Part2()); }