Beispiel #1
0
            public void EmptyGrid_PlacesLetterAsExpected()
            {
                WordGrid grid             = new WordGrid(6);
                var      ableToDropLetter = grid.DropLetter('A', 0);

                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("      ", grid.Lines[0]);
                Assert.AreEqual("      ", grid.Lines[1]);
                Assert.AreEqual("      ", grid.Lines[2]);
                Assert.AreEqual("      ", grid.Lines[3]);
                Assert.AreEqual("      ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);
            }
Beispiel #2
0
            public void FillColumn_PlacesLetterAsExpected()
            {
                WordGrid grid             = new WordGrid(6);
                var      ableToDropLetter = grid.DropLetter('A', 0);

                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("      ", grid.Lines[0]);
                Assert.AreEqual("      ", grid.Lines[1]);
                Assert.AreEqual("      ", grid.Lines[2]);
                Assert.AreEqual("      ", grid.Lines[3]);
                Assert.AreEqual("      ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);

                ableToDropLetter = grid.DropLetter('B', 0);
                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("      ", grid.Lines[0]);
                Assert.AreEqual("      ", grid.Lines[1]);
                Assert.AreEqual("      ", grid.Lines[2]);
                Assert.AreEqual("      ", grid.Lines[3]);
                Assert.AreEqual("B     ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);

                ableToDropLetter = grid.DropLetter('C', 0);
                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("      ", grid.Lines[0]);
                Assert.AreEqual("      ", grid.Lines[1]);
                Assert.AreEqual("      ", grid.Lines[2]);
                Assert.AreEqual("C     ", grid.Lines[3]);
                Assert.AreEqual("B     ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);

                ableToDropLetter = grid.DropLetter('D', 0);
                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("      ", grid.Lines[0]);
                Assert.AreEqual("      ", grid.Lines[1]);
                Assert.AreEqual("D     ", grid.Lines[2]);
                Assert.AreEqual("C     ", grid.Lines[3]);
                Assert.AreEqual("B     ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);

                ableToDropLetter = grid.DropLetter('E', 0);
                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("      ", grid.Lines[0]);
                Assert.AreEqual("E     ", grid.Lines[1]);
                Assert.AreEqual("D     ", grid.Lines[2]);
                Assert.AreEqual("C     ", grid.Lines[3]);
                Assert.AreEqual("B     ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);

                ableToDropLetter = grid.DropLetter('F', 0);
                Assert.AreEqual(true, ableToDropLetter);
                Assert.AreEqual("F     ", grid.Lines[0]);
                Assert.AreEqual("E     ", grid.Lines[1]);
                Assert.AreEqual("D     ", grid.Lines[2]);
                Assert.AreEqual("C     ", grid.Lines[3]);
                Assert.AreEqual("B     ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);

                ableToDropLetter = grid.DropLetter('G', 0);
                Assert.AreEqual(false, ableToDropLetter);
                Assert.AreEqual("F     ", grid.Lines[0]);
                Assert.AreEqual("E     ", grid.Lines[1]);
                Assert.AreEqual("D     ", grid.Lines[2]);
                Assert.AreEqual("C     ", grid.Lines[3]);
                Assert.AreEqual("B     ", grid.Lines[4]);
                Assert.AreEqual("A     ", grid.Lines[5]);
            }