public void testCalculateChecksum_PartB() { var sut = new DayTwo(); var result = sut.PartB(); Assert.Equal("282", result); }
public void testCalculateLineEvenDivision(string line, long expected) { var sut = new DayTwo(); var result = sut.CalculateLineEvenDivision(line); Assert.Equal(expected, result); }
protected async Task ShowResults() { if (ValidateTextbox()) { invalid = false; DayTwo _challengeSolver = new DayTwo(); _partOne = 0; _partTwo = 0; await RefreshReport(); if (_passwords.Count > 0) { _partOne = _challengeSolver.PartOne(_passwords); _partTwo = _challengeSolver.PartTwo(_passwords); } if (_partOne != 0 && _partTwo != 0) { childOne.Show(); childTwo.Show(); } else { invalid = true; } } else { invalid = true; } }
public void PartB_Actual() { var sut = new DayTwo(); var result = sut.PartB(); Assert.Equal("649", result); }
public void testCalculateLineDifference(string line, long expected) { var sut = new DayTwo(); var result = sut.CalculateLineDifference(line); Assert.Equal(expected, result); }
public void PartB_Actual() { var sut = new DayTwo(); var result = sut.PartB(); Assert.Equal("mbruvapghxlzycbhmfqjonsie", result); }
public void ContainsNumberOfDuplicateLetters(string input, int duplicatesRequired, bool expected) { var sut = new DayTwo(); var result = sut.ContainsNumberOfDuplicateLetters(input, duplicatesRequired); Assert.Equal(expected, result); }
public void CalculateCheckSum(string input, int expected) { var sut = new DayTwo(); var result = sut.CalculateCheckSum(input); Assert.Equal(expected, result); }
public void testDetermineBathroomCodeSimple(string expected, string input) { var sot = new DayTwo(); var result = sot.DetermineBathroomCode(input, 1, 1, DayTwo.KEY_PAD); Assert.Equal(expected, result); }
public void testWithActualPartB() { var sot = new DayTwo(); var result = sot.DetermineBathroomCode(DayTwo.PUZZLE_INPUT, 1, 1, DayTwo.KEY_PAD_TWO); Assert.Equal("46C91", result); }
public void PartA_Actual() { var sut = new DayTwo(); var result = sut.PartA(); Assert.Equal("454", result); }
static void Main(string[] args) { var inputFilesFolder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var content = File.ReadAllText(Path.Combine(inputFilesFolder, "input2.txt")); var result = new DayTwo().Solve(content, true); Console.WriteLine("Result is: " + result); }
public void CalculateCheckSumLines() { var filePath = @"Two\DayTwoTestInputB.txt"; var sut = new DayTwo(); var result = sut.FindCommonLetters(filePath); Assert.Equal("fgij", result); }
public void Solution() { const string Expected = "ivjhcadokeltwgsfsmqwrbnuy"; var input = Resources.InputD2P1.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).ToArray(); var actual = DayTwo.CommonLetters(input); Assert.Equal(Expected, actual); }
public void Test1() { var input = new[] { "abcde", "fghij", "klmno", "pqrst", "fguij", "axcye", "wvxyz" }; const string Expected = "fgij"; var actual = DayTwo.CommonLetters(input); Assert.Equal(Expected, actual); }
public void CallengeOne_TestSituation1() { string input = "abcdef"; var(Twice, ThreeTimes) = DayTwo.CountTwiceAndThreeTimes(input); Assert.AreEqual(false, Twice); Assert.AreEqual(false, ThreeTimes); }
public void CallengeOne_TestSituation2() { string input = "bababc"; var(Twice, ThreeTimes) = DayTwo.CountTwiceAndThreeTimes(input); Assert.AreEqual(true, Twice); Assert.AreEqual(true, ThreeTimes); }
public void Solution() { const int Expected = 7657; var input = Resources.InputD2P1.Split(Environment.NewLine).ToArray(); var actual = DayTwo.Checksum(input); Assert.Equal(Expected, actual); }
public void Test1() { var input = new[] { "abcdef", "bababc", "abbcde", "abcccd", "aabcdd", "abcdee", "ababab" }; const int Expected = 12; var actual = DayTwo.Checksum(input); Assert.Equal(Expected, actual); }
public void BasicCasesPass() { var dayTwo = new DayTwo(); Assert.AreEqual(3500, dayTwo.Solve("1,9,10,3,2,3,11,0,99,30,40,50")); Assert.AreEqual(30, dayTwo.Solve("1,1,1,4,99,5,6,0,99")); Assert.AreEqual(2, dayTwo.Solve("1,0,0,0,99")); Assert.AreEqual(2, dayTwo.Solve("2,3,0,3,99")); }
public void testDetermineBathroomCode() { string input = @"ULL RRDDD LURDL UUUUD"; var sot = new DayTwo(); var result = sot.DetermineBathroomCode(input, 1, 1, DayTwo.KEY_PAD); Assert.Equal("1985", result); }
public void ChallengeOne_TestSituationComplete() { string input = @" abcdef bababc abbcde abcccd aabcdd abcdee ababab"; int result = DayTwo.ComputeChallengeOneResult(input); Assert.AreEqual(12, result); }
static void Main(string[] args) { Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); var dayTwoOutput = DayTwo.ValidPasswordCountProblemOne(Properties.Resources.Exercise_02.Split(Environment.NewLine)); stopwatch.Stop(); Console.WriteLine($"Day Two Output: {dayTwoOutput} completed in {stopwatch.Elapsed.TotalMilliseconds} milliseconds"); stopwatch.Reset(); stopwatch.Start(); var dayTwoOutputProblem02 = DayTwo.ValidPasswordCountProblemTwo(Properties.Resources.Exercise_02.Split(Environment.NewLine)); stopwatch.Stop(); Console.WriteLine($"Day Two Output: {dayTwoOutputProblem02} completed in {stopwatch.Elapsed.TotalMilliseconds} milliseconds"); }
static void Main() { DayOne.TaskOne(); DayOne.TaskTwo(); DayTwo.TaskOne(); DayTwo.TaskTwo(); DayThree.TaskOne(); DayThree.TaskTwo(); DayFour.TaskOne(); DayFour.TaskTwo(); DaySix.TaskOne(); DaySix.TaskTwo(); Console.Read(); }
public void Day2_P2Test() { var input = File.ReadAllText("./Files/Day_2/Day2_Test.input").Split("\r\n"); Assert.AreEqual(1, DayTwo.Day2_P2(input)); }
public void PartOne() { var dayTwo = new DayTwo(); var output = dayTwo.PartOne(FilePath); }
static void Main(string[] args) { /* try{ * var dayOne = new DayOne(); * Console.WriteLine(dayOne.RunTestsAndGetResultPartOne()); * Console.WriteLine(dayOne.RunTestsAndGetResultPartTwo()); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } */ try{ var dayTwo = new DayTwo(); Console.WriteLine(dayTwo.RunTestsAndGetResultPartOne()); // Console.WriteLine(dayTwo.GetResultPartTwo()); } catch (Exception ex) { Console.WriteLine(ex.Message); } /* * try{ * var dayThree = new DayThree(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(dayThree.RunTestsAndGetResultPartOne()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } * * try{ * var dayThree = new DayThree(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(dayThree.RunTestsAndGetResultPartTwo()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } */ /* * try{ * var dayFour = new DayFour(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(dayFour.RunTestsAndGetResultPartOne()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } */ try{ var dayFive = new DayFive(); var watch = System.Diagnostics.Stopwatch.StartNew(); dayFive.RunTestsAndShowResultPartOne(); watch.Stop(); Console.WriteLine("Time:" + watch.ElapsedMilliseconds); } catch (Exception ex) { Console.WriteLine(ex.Message); } try{ var dayFive = new DayFive(); var watch = System.Diagnostics.Stopwatch.StartNew(); dayFive.RunTestsAndShowResultPartTwo(); watch.Stop(); Console.WriteLine("Time:" + watch.ElapsedMilliseconds); } catch (Exception ex) { Console.WriteLine(ex.Message); } /* * try{ * var daySix = new DaySix(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(daySix.RunTestsAndGetResultPartOne()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } * * try{ * var daySix = new DaySix(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(daySix.RunTestsAndGetResultPartTwo()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } */ try{ var daySeven = new DaySeven(); var watch = System.Diagnostics.Stopwatch.StartNew(); Console.WriteLine(daySeven.RunTestsAndGetResultPartOne()); watch.Stop(); Console.WriteLine("Time:" + watch.ElapsedMilliseconds); } catch (Exception ex) { Console.WriteLine(ex.Message); } try{ var daySeven = new DaySeven(); var watch = System.Diagnostics.Stopwatch.StartNew(); Console.WriteLine(daySeven.RunTestsAndGetResultPartTwo()); watch.Stop(); Console.WriteLine("Time:" + watch.ElapsedMilliseconds); } catch (Exception ex) { Console.WriteLine(ex.Message); } /* * try{ * var dayEight = new DayEight(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(dayEight.RunTestsAndGetResultPartOne()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } * * try{ * var dayEight = new DayEight(); * var watch = System.Diagnostics.Stopwatch.StartNew(); * Console.WriteLine(dayEight.RunTestsAndGetResultPartTwo()); * watch.Stop(); * Console.WriteLine("Time:" + watch.ElapsedMilliseconds); * } * catch(Exception ex){ * Console.WriteLine(ex.Message); * } */ try{ var dayNine = new DayNine(); var watch = System.Diagnostics.Stopwatch.StartNew(); Console.WriteLine(dayNine.RunTestsAndGetResultPartOne()); watch.Stop(); Console.WriteLine("Time:" + watch.ElapsedMilliseconds); } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void DayTwoPartTwoReturnsCorrectly(string input, int expected) { var result = DayTwo.PartTwo(input); Assert.AreEqual(expected, result); }
public void PartTwo() { var dayTwo = new DayTwo(); var output = new string(dayTwo.PartTwo(FilePath).ToArray()); }
public int[] ProblemOne_ValidInput_ReturnsCorrectResult(int[] inp) => DayTwo.ProblemOne(inp);