public void Get_Firewall_Dictionnary() { var lines = reader.GetContentByLine("Day13ExFile"); var layerDictionnary = advent.GetLayers(lines); Check.That(layerDictionnary.Count).Equals(lines.Count); }
public void Get_Number_Group() { var reader = new ReadFile(); var lines = reader.GetContentByLine("Day12ExFile"); var nodes = advent.GetNodes(lines); var numberGroup = advent.GetNumberGroup(nodes, 0); Check.That(numberGroup).Equals(2); }
public void Get_All_Programs_On_Zero_Group() { var reader = new ReadFile(); var lines = reader.GetContentByLine("Day12ExFile"); var nodes = advent.GetNodes(lines); var nodeInSameGroup = advent.GetNodesInSameGroup(nodes, 0); Check.That(nodeInSameGroup.Count).Equals(6); }
public void Get_Higher_Value_During_Process() { var reader = new ReadFile(); var lines = reader.GetContentByLine("Day08ExFile"); foreach (var line in lines) { var instructionParts = advent.GetInstructionParts(line); advent.ProcessInstructionResult(instructionParts); } Check.That(advent.HigherValueDuringProcess).Equals(10); }
public void Get_Processed_Instruction() { var reader = new ReadFile(); var lines = reader.GetContentByLine("Day08ExFile"); foreach (var line in lines) { var instructionParts = advent.GetInstructionParts(line); advent.ProcessInstructionResult(instructionParts); } Check.That(advent.Register.Max(r => r.Value)).Equals(1); }
public void Get_The_Bottom_Program() { var reader = new ReadFile(); var listProgramm = new List <Program>(); var lines = reader.GetContentByLine("Day07ExFile"); foreach (var line in lines) { listProgramm.Add(advent.Parse(line)); } var bottomProgram = advent.GetBottomProgram(listProgramm); Check.That(bottomProgram.Name).Equals("tknk"); }
public void Get_The_Balance_Weight(int weightToSubstractExpected) { 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 = advent.GetTheUnbalancedTowerProgram(listProgram); Check.That(GetWeightToSubtract(program)).Equals(weightToSubstractExpected); }
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); }