Exemple #1
0
            public void ReturnsExpectedResults()
            {
                WordHexagon hexagon = new WordHexagon(4)
                {
                    Lines =
                    {
                        // ReSharper disable StringLiteralTypo
                        [0] = "abcd",
                        [1] = "efghi",
                        [2] = "jklmno",
                        [3] = "p9q*rst",
                        [4] = "uvwxyz",
                        [5] = "01234",
                        [6] = "5678"
                    }
                };

                Assert.AreEqual("pu05", hexagon.CalculateDiagonalWordPattern(0));
                Assert.AreEqual("j9v16", hexagon.CalculateDiagonalWordPattern(1));
                Assert.AreEqual("ekqw27", hexagon.CalculateDiagonalWordPattern(2));
                Assert.AreEqual("afl", hexagon.CalculateDiagonalWordPattern(3));
                Assert.AreEqual("x38", hexagon.CalculateDiagonalWordPattern(4));
                Assert.AreEqual("bgmry4", hexagon.CalculateDiagonalWordPattern(5));
                Assert.AreEqual("chnsz", hexagon.CalculateDiagonalWordPattern(6));
                Assert.AreEqual("diot", hexagon.CalculateDiagonalWordPattern(7));
                // ReSharper restore StringLiteralTypo
            }
Exemple #2
0
            public void ReturnsExpectedResults()
            {
                WordHexagon hexagon = new WordHexagon
                {
                    Lines =
                    {
                        // ReSharper disable StringLiteralTypo
                        [0] = "abc",
                        [1] = "defg",
                        [2] = "hijkl",
                        [3] = "mnop",
                        [4] = "qrs"
                    }
                };

                Assert.AreEqual("hmq", hexagon.CalculateDiagonalWordPattern(0));
                Assert.AreEqual("dinr", hexagon.CalculateDiagonalWordPattern(1));
                Assert.AreEqual("aejos", hexagon.CalculateDiagonalWordPattern(2));
                Assert.AreEqual("bfkp", hexagon.CalculateDiagonalWordPattern(3));
                Assert.AreEqual("cgl", hexagon.CalculateDiagonalWordPattern(4));
                // ReSharper restore StringLiteralTypo
            }