コード例 #1
0
        public void StringToIntTest()
        {
            string image = "123456789012";

            int[] expected = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2 };

            var result = UtilsDay8.StringToIntArray(image);

            Assert.Equal(expected, result);
        }
コード例 #2
0
        public void DecodeTest()
        {
            string image = "123456789012";
            var    data  = UtilsDay8.StringToIntArray(image);
            var    img   = new ComplexImage(3, 2, data);

            Assert.Equal(new int[] { 1, 2, 3 }, img.Data[0][0]);
            Assert.Equal(new int[] { 4, 5, 6 }, img.Data[0][1]);
            Assert.Equal(new int[] { 7, 8, 9 }, img.Data[1][0]);
            Assert.Equal(new int[] { 0, 1, 2 }, img.Data[1][1]);
        }