Exemplo n.º 1
0
        public void Get_The_Total_Weight(string name, int totalWeightExpected)
        {
            var reader      = new ReadFile();
            var listProgram = new List <Program>();
            var lines       = reader.GetContentByLine("Day07ExFile");

            foreach (var line in lines)
            {
                listProgram.Add(advent.Parse(line));
            }

            listProgram = advent.GetUpdatedPrograms(listProgram);
            var program = listProgram.First(lp => lp.Name == name);

            Check.That(program.Children.Sum(c => c.Weight) + program.Weight).Equals(totalWeightExpected);
        }