public void Day14_TestReadPolymers_PolyKey_10_OK() { var lines = Utils.ReadLinesFromFile("Day14Test.txt"); Assert.Equal(18, lines.Length); var sut = new PolymerizerKey(lines); Assert.Equal("NNCB", sut.Template); sut.PairInsertion(10); long actual = sut.QuantityOfElements(); Assert.Equal(1588, actual); }
public void Day14_Puzzle1_PolyKey_OK() { var lines = Utils.ReadLinesFromFile("Day14.txt"); Assert.Equal(102, lines.Length); var sut = new PolymerizerKey(lines); Assert.Equal("KOKHCCHNKKFHBKVVHNPN", sut.Template); sut.PairInsertion(10); long actual = sut.QuantityOfElements(); Assert.Equal(3406, actual); }
public void Day14_TestReadPolymers_Roboot2_OK() { var lines = Utils.ReadLinesFromFile("Day14Test.txt"); Assert.Equal(18, lines.Length); var sut = new PolymerizerKey(lines); Assert.Equal("NNCB", sut.Template); sut.PairInsertion(4); string expected = "NBBNBNBBCCNBCNCCNBBNBBNBBBNBBNBBCBHCBHHNHCBBCBHCB"; long actual = sut.QuantityOfElements(); actual = sut.Elems.Values.Sum(); Assert.Equal(expected.Length, actual); }