Esempio n. 1
0
        public void NotFindsPositionOfBWordInOneLetterMatrixWithACharacter()
        {
            WordPuzzle wordPuzzle = new WordPuzzle(new char[, ] {
                { 'a' }
            });

            Assert.AreEqual(null, wordPuzzle.SearchWord("b"));
        }
Esempio n. 2
0
        public void FindsPositionOfHojInFirstColumn()
        {
            var wordPuzzle = new WordPuzzle(new[, ] {
                { 'a' }, { 'h' }, { 'o' }, { 'j' }
            });

            Assert.AreEqual(new Vector {
                First = new Point {
                    X = 0, Y = 1
                }, Last = new Point {
                    X = 0, Y = 3
                }
            }, wordPuzzle.SearchWord("hoj"));
        }
Esempio n. 3
0
        public void FindsPositionOfHojWordInMatrixWithMultipleLines()
        {
            var wordPuzzle = new WordPuzzle(new[, ] {
                { 'a', 'h', 'o', 's' }, { 'a', 'h', 'o', 'j' }
            });

            Assert.AreEqual(new Vector {
                First = new Point {
                    X = 1, Y = 1
                }, Last = new Point {
                    X = 3, Y = 1
                }
            }, wordPuzzle.SearchWord("hoj"));
        }
Esempio n. 4
0
        public void FindsPositionOfAWordInOneLetterMatrixWithACharacter()
        {
            WordPuzzle wordPuzzle = new WordPuzzle(new char[, ] {
                { 'a' }
            });

            Assert.AreEqual(new Vector()
            {
                First = new Point()
                {
                    X = 0, Y = 0
                }, Last = new Point()
                {
                    X = 0, Y = 0
                },
            }
                            , wordPuzzle.SearchWord("a"));
        }