public void Day11() { var d = new Day11(); Assert.AreEqual(2346, d.StabalizedNeighborSeatCount()); Assert.AreEqual(2111, d.StabalizedVisibleSeatCount()); }
public void ContainsTwoNoOverlappingPairs(string input, bool expected) { var day11 = new Day11(); var actual = day11.ContainsTwoNoOverlappingPairs(input); Assert.Equal(expected, actual); }
public void FindNextPassword(string input, string expected) { var day11 = new Day11(); var actual = day11.FindNextPassword(input); Assert.Equal(expected, actual); }
public void Part2_Answer() { var day11 = new Day11(); var(_, actual) = day11.Walk(PUZZLE_INPUT); Assert.Equal(1558, actual); }
public void ContainsStraight(string input, bool expected) { var day11 = new Day11(); var actual = day11.ContainsStraight(input); Assert.Equal(expected, actual); }
public void EmptyEight(string file, int expected, int x, int y) { day11 = new Day11(file); var result = day11.GetNeighborsInSight(x, y, day11.GetInitialState( )); Assert.AreEqual(expected, result.Where(c => c == '#').Count( )); }
public void Part1(string route, int expected) { var day11 = new Day11(); var(actual, _) = day11.Walk(route); Assert.Equal(expected, actual); }
public void CanSolvePart2(string[] room, int expected) { var day = new Day11(); var result = day.Solve(room.Select(str => str.ToCharArray()).ToArray(), true); Assert.Equal(expected, result); }
public void GetDay11Part02AnswerTest() { int expected = 2214; int actual = Day11.GetDay11Part02Answer(); Assert.Equal(expected, actual); }
public void Day11_Part1_Examples_Passwords() { var d = new Day11(); Assert.AreEqual("abcdffaa", d.Solution("abcdefgh")); Assert.AreEqual("ghjaabcc", d.Solution("ghijklmn")); }
public void TestSeatChaosVisible() { var input = Day11.ParseSeatGrid("Advent_of_Code_2020.Day11.SampleInput.txt"); var grid = Day11.SimulateSeatsVisible(input); Assert.Equal(26, grid.Sum(row => row.Count(c => c == '#'))); }
public void RunDay11Part2Test() { int expected = 249; int actual = Day11.RunDay11Part2(); Assert.Equal(expected, actual); }
public void Examples1() { Assert.That(Day11.Solve("ne,ne,ne").Item1, Is.EqualTo(3)); Assert.That(Day11.Solve("ne,ne,sw,sw").Item1, Is.EqualTo(0)); Assert.That(Day11.Solve("ne,ne,s,s").Item1, Is.EqualTo(2)); Assert.That(Day11.Solve("se,sw,se,sw,sw").Item1, Is.EqualTo(3)); }
public void Part1_getpowerlevel_should_return_correct_result(int x, int y, int serialNumber, int expectedResult) { Assert.That(Day11.GetPowerLevel((x, y), serialNumber), Is.EqualTo(expectedResult)); Assert.That(Day11.GetHighestSquarePowerLevel(18), Is.EqualTo(29)); Assert.That(Day11.GetHighestSquarePowerLevel(42), Is.EqualTo(30)); }
public void ResolvePart2__Test2() { Day11 day = new Day11(); string result = day.ResolvePart2(new string[] { "42" }); Assert.AreEqual("232,251,12", result); }
public void PartBTests(string input, string expectedOutput) { var day = new Day11(); var result = day.SolveB(input); Assert.AreEqual(expectedOutput, result); }
public void Part2( ) { day11 = new Day11("day11test6"); var actual = day11.SolvePart2( ); Assert.AreEqual(26.ToString( ), actual); }
public void GetPowerTest(int x, int y, int serial, sbyte expectedPower) { var day = new Day11(); var power = day.GetPower(x, y, serial); Assert.AreEqual(expectedPower, power); }
public void Stars() { var run = new Day11(); Assert.Equal("2310", run.Result1()); Assert.Equal("2074", run.Result2()); }
static void Main(string[] args) { Day11.Puzzle1(); Console.WriteLine("Press any key to exit"); Console.ReadKey(); }
public void Part1_Answer() { var day11 = new Day11(); var(actual, _) = day11.Walk(PUZZLE_INPUT); Assert.Equal(784, actual); }
public void Part1(int numSteps, int expected) { var day = new Day11(); var actual = Day11.Part1(_input, numSteps); Assert.Equal(expected, actual); }
public void Day11() { var day = new Day11(); Assert.Equal(805, day.FirstPart()); Assert.Equal(1535, day.SecondPart()); }
public void CalculatePowerLevelOfRegion__Test1_WithSumationField() { int[,] summationFiled = Day11.GenerateSumationField(300, 300, 18); int powerLevel = Day11.CalculatePowerLevelOfRegion(33, 45, 3, summationFiled); Assert.AreEqual(29, powerLevel); }
public void ContainsForbiddenCharacters(string input, bool expected) { var day11 = new Day11(); var actual = day11.ContainsForbiddenCharacters(input); Assert.Equal(expected, actual); }
public void CalculatePowerLevelOfRegion__Test2_WithSumationField() { int[,] summationFiled = Day11.GenerateSumationField(300, 300, 42); int powerLevel = Day11.CalculatePowerLevelOfRegion(21, 61, 3, summationFiled); Assert.AreEqual(30, powerLevel); }
public void PasswordIsValid(string input, bool expected) { var day11 = new Day11(); var actual = day11.PasswordIsValid(input); Assert.Equal(expected, actual); }
public void ResolvePart2__Test1() { Day11 day = new Day11(); string result = day.ResolvePart2(new string[] { "18" }); Assert.AreEqual("90,269,16", result); }
public void Task2() { Assert.AreEqual(3, Day11.Task2("ne,ne,ne".Split(',').ToList())); Assert.AreEqual(2, Day11.Task2("ne,ne,sw,sw".Split(',').ToList())); Assert.AreEqual(2, Day11.Task2("ne,ne,s,s".Split(',').ToList())); Assert.AreEqual(3, Day11.Task2("se,sw,se,sw,sw".Split(',').ToList())); }
public void Test_Step1() { var d11 = new Day11(); d11.Step(defaultInput); Assert.AreEqual("#.##.##.##", d11.Rows[0]); Assert.AreEqual("#.#####.##", d11.Rows[^ 1]);