From cb10768fa14c4b6ec19d050e13a0c3e00c152874 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 16 Dec 2020 18:06:36 -0500 Subject: move project to subdirectory and add unit testing day 13 is removed from the test so it doesn't take 4 years --- Day.cs | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 Day.cs (limited to 'Day.cs') diff --git a/Day.cs b/Day.cs deleted file mode 100644 index eb3ef49..0000000 --- a/Day.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using aoc2019.lib; - -namespace aoc2019 -{ - public abstract class Day - { - protected Day(int dayNumber, string puzzleName) - { - DayNumber = dayNumber; - PuzzleName = puzzleName; - } - - public int DayNumber { get; } - public string PuzzleName { get; } - - protected virtual IEnumerable Input => - File.ReadLines(FileName); - - protected string FileName => - Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"input/day{DayNumber,2:00}.in"); - - public void AllParts(bool verbose = true) - { - Console.WriteLine($"Day {DayNumber,2}: {PuzzleName}"); - var s = Stopwatch.StartNew(); - var part1 = Part1(); - s.Stop(); - Console.Write($"Part1: {part1,-15} "); - Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); - - s.Reset(); - - s.Start(); - var part2 = Part2(); - s.Stop(); - Console.Write($"Part2: {part2,-15} "); - Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); - - Console.WriteLine(); - } - - protected abstract string Part1(); - protected abstract string Part2(); - } -} \ No newline at end of file -- cgit 1.4.1