public void BuildRaw() { TreeMaxPath.Pyramid pyramid = TreeMaxPath.PyramidBuilder.BuildFromRaw(new List <int[]> { new int[] { 1 }, new int[] { 1, 2 } }); Assert.AreEqual(1, pyramid.GetLastRow()[0].Value); Assert.AreEqual(2, pyramid.GetLastRow()[1].Value); Assert.AreEqual(1, pyramid.GetPenultimateRow()[0].Value); }
public void BuildFromFile() { using (StreamWriter writer = new StreamWriter(nameof(BuildFromFile) + ".txt")) { writer.WriteLine("1"); writer.WriteLine("4 2"); } TreeMaxPath.Pyramid pyramid = TreeMaxPath.PyramidBuilder.BuildFromFile(nameof(BuildFromFile) + ".txt"); Assert.AreEqual(1, pyramid.GetLastRow()[0].Value); Assert.AreEqual(4, pyramid.GetLastRow()[1].Value); Assert.AreEqual(2, pyramid.GetPenultimateRow()[0].Value); }