public void ParsesExampleString(string input, Tuple <int, int, int> expected) { var day2 = new Day2(); var actual = day2.ParseStringToTuple(input); Assert.Equal(expected, actual); }
public void CanSolvePositionCharsPasswordRule(string[] passwords, int expected) { var day2 = new Day2(); var result = day2.Solve <PositionCharsPasswordRule>(passwords); Assert.Equal(expected, result); }
public void CalculatesTotalAreaCorrectly(string input, int expected) { var day2 = new Day2(); var actual = day2.TotalArea(input); Assert.Equal(expected, actual); }
public void CalculateRibbon(int x, int y, int z, int expected) { var day2 = new Day2(); var actual = day2.CalculateRibbonLength(new Tuple <int, int, int>(x, y, z)); Assert.Equal(expected, actual); }
public void CalculatesCorrectSizeForSinglePresent(int x, int y, int z, int expected) { var day2 = new Day2(); var actual = day2.CalculateArea(new Tuple <int, int, int>(x, y, z)); Assert.Equal(expected, actual); }
public void CalculateTotalRibbon(string input, int expected) { var day2 = new Day2(); var actual = day2.TotalRibbon(input); Assert.Equal(expected, actual); }
public void Part2FullTest() { var input = new[] { "5 9 2 8", "9 4 7 3", "3 8 6 5" }; var result = Day2.Solve(input, Day2.Part2LineLogic); Assert.Equal(9, result); }
public void Part1FullTest() { var input = new[] { "5 1 9 5", "7 5 3", "2 4 6 8" }; var result = Day2.Solve(input, Day2.Part1LineLogic); Assert.Equal(18, result); }
public void CalculatesRealTotalAreaCorrectly() { const int TotalArea = 1588178; var day2 = new Day2(); var actual = day2.TotalArea(LoadFromResource.Load("AdventOfCode.Tests.TestData.Day2.txt")); Assert.Equal(TotalArea, actual); }
public void ActualTotalRibbon() { const int TotalRibbon = 3783758; var day2 = new Day2(); var actual = day2.TotalRibbon(LoadFromResource.Load("AdventOfCode.Tests.TestData.Day2.txt")); Assert.Equal(TotalRibbon, actual); }
public Day2Test() { var dataHandler = new DataHandler(); this.day = new Day2(dataHandler) { pathToData = @"../../../Data/day2.txt" }; this.day.ReadData(); }
public void TestPartB() { string[] passwordAndPolicyStrings = new string[] { "1-3 a: abcde", "1-3 b: cdefg", "2-9 c: ccccccccc" }; var data = new StringData(passwordAndPolicyStrings); int expectedOutput = 1; Day2 day2 = new Day2(data); var actualOutut = day2.Puzzle2Solution(); Assert.AreEqual(expectedOutput, actualOutut); }
public void TestDay2Part2(string[] input, string answer) { Day2. Part2(input). ShouldBeEquivalentTo(answer); }
public void Part2RealPuzzle() { var result = Day2.Solve(GetPuzzleInput(), Day2.Part2LineLogic); Assert.Equal(250, result); }
public void Part2LineTests(string input, int expected) { var result = Day2.Part2LineLogic(input); Assert.Equal(expected, result); }
public void Part1RealPuzzle() { var result = Day2.Solve(GetPuzzleInput(), Day2.Part1LineLogic); Assert.Equal(47136, result); }