public void DecompressTest_5() { string testData = System.IO.File.ReadAllText(@"Inputs\day09.txt").Replace("\r", ""); var result = Day09.Decompress(testData); Assert.AreEqual(107035, result.Length); }
public void Version1Tests() { var day = new Day09(""); Assert.Equal("ADVENT", day.Decompress("ADVENT", 1, false)); Assert.Equal("ABBBBBC", day.Decompress("A(1x5)BC", 1, false)); Assert.Equal("XYZXYZXYZ", day.Decompress("(3x3)XYZ", 1, false)); Assert.Equal("ABCBCDEFEFG", day.Decompress("A(2x2)BCD(2x2)EFG", 1, false)); Assert.Equal("(1x3)A", day.Decompress("(6x1)(1x3)A", 1, false)); Assert.Equal("X(3x3)ABC(3x3)ABCY", day.Decompress("X(8x2)(3x3)ABCY", 1, false)); }
public void Version2Tests() { var day = new Day09(""); day.Decompress("(3x3)XYZ", 2, false); Assert.Equal("9", day.GetSecondResult()); day = new Day09(""); day.Decompress("X(8x2)(3x3)ABCY", 2, false); Assert.Equal("20", day.GetSecondResult()); day = new Day09(""); day.Decompress("(27x12)(20x12)(13x14)(7x10)(1x12)A", 2, false); Assert.Equal("241920", day.GetSecondResult()); day = new Day09(""); day.Decompress("(25x3)(3x3)ABC(2x3)XY(5x2)PQRSTX(18x9)(3x2)TWO(5x7)SEVEN", 2, false); Assert.Equal("445", day.GetSecondResult()); }
public void DecompressTest_4() { Assert.AreEqual("X(3x3)ABC(3x3)ABCY", Day09.Decompress("X(8x2)(3x3)ABCY")); }
public void DecompressTest_3() { Assert.AreEqual("(1x3)A", Day09.Decompress("(6x1)(1x3)A")); }
public void DecompressTest_2() { Assert.AreEqual("ABBBBBC", Day09.Decompress("A(1x5)BC")); }
public void DecompressTest_1() { Assert.AreEqual("ADVENT", Day09.Decompress("ADVENT")); }