public override Day Run() { dayOfMonth = 18; stopwatch.Start(); ShuntingYard homework = new ShuntingYard(); answer_part1 = homework.SumOfExpressionsFromFile(false, "input/day18.txt").ToString(); answer_part2 = homework.SumOfExpressionsFromFile(true, "input/day18.txt").ToString(); return(this); }
public void TestSumOfExpressionsInFile() { ShuntingYard homework = new ShuntingYard(); Assert.Equal(26 + 437 + 12240 + 13632, homework.SumOfExpressionsFromFile(false, "input/day18.txt")); }
public void TestSumOfExpressionsWithPrecedenceInFile() { ShuntingYard homework = new ShuntingYard(); Assert.Equal(46 + 1445 + 669060 + 23340, homework.SumOfExpressionsFromFile(true, "input/day18.txt")); }
public void TestEvaluate(string expression, bool precedence, int expected) { ShuntingYard homework = new ShuntingYard(); Assert.Equal(expected, homework.Evaluate(precedence, expression)); }