예제 #1
0
파일: Board.cs 프로젝트: dedale/wordox
        [Test] public void TestPlayBetween()
        {
            var list = new List <WordPart>();

            list.Add(new WordPart("LET", new Cell(4, 0), Direction.Right));
            list.Add(new WordPart("RE", new Cell(4, 4), Direction.Right));
            var parts  = new WordPartCollection(list.ToConstant());
            var played = parts.Play(new Cell(4, 3), 'T');

            Assert.AreEqual(1, played.Count);
            Assert.AreEqual(new WordPart("LETTRE", new Cell(4, 0), Direction.Right), played[0]);
        }
예제 #2
0
파일: Board.cs 프로젝트: dedale/wordox
        [Test] public void TestPlaySimple()
        {
            var list = new List <WordPart>();

            list.Add(new WordPart("MOT", new Cell(4, 4), Direction.Right));
            var parts    = new WordPartCollection(list.ToConstant());
            var newParts = parts.Play(new Cell(4, 7), 'S');

            Assert.AreEqual(1, newParts.Count);
            Assert.AreEqual("MOTS", newParts[0].Word);
            Assert.AreEqual(new Cell(4, 4), newParts[0].First);
            Assert.AreEqual(Direction.Right, newParts[0].Direction);
        }