public void P8_TestLoadInput() { var puz = new Puzzle08(); var result = puz.TestLoadInput(); Assert.IsFalse(result.IsFaulted, "Faulted - is data file available and set as an embedded resource?"); Assert.IsNull(result.Exception, "Had an exception."); Assert.IsInstanceOfType(result.Result, typeof(int), "Result is not an integer."); Assert.AreNotEqual(0, result.Result, "Result is 0."); }
private static void Main(string[] args) { var result1 = Puzzle08.CountTask1(PuzzleInput.ToPuzzle8Input()); Console.WriteLine($"Count task 1: {result1}"); var result2 = Puzzle08.CountTask2(PuzzleInput.ToPuzzle8Input()); Console.WriteLine($"Count task 2: {result2}"); }
public void Task1_Count() { var stringInput = @"nop +0 acc +1 jmp +4 acc +3 jmp -3 acc -99 acc +1 jmp -4 acc +6"; var count = Puzzle08.CountTask1(stringInput.ToPuzzle8Input()); Assert.Equal(5, count); }