コード例 #1
0
 public void TestConstructorIfReturnValidRowLenthWithSeven()
 {
     var grid = new Grid(7, 7);
     var expect = grid.TotalRows;
     var actual = 7;
     Assert.AreEqual(expect, actual);
 }
コード例 #2
0
 public void TestConstructorIfReturnValidRowLenthWithDefautValue()
 {
     var grid = new Grid();
     var expect = grid.TotalRows;
     var actual = 15;
     Assert.AreEqual(expect, actual);
 }
コード例 #3
0
 public void TestSetCellMethodIfSetCurrectlyValueWithIntValueParameter()
 {
     var grid = new Grid();
     grid.SetCell(3, 3, 'X');
     var expect = 'X';
     var actual = grid.Field[3, 3];
     Assert.AreEqual(expect, actual);
 }
コード例 #4
0
 public void TestSetCellMethodIfSetCurrectlyValueWithPositionValue()
 {
     var position = new Position(3, 3);
     var grid = new Grid();
     grid.SetCell(position.X, position.Y, 'X');
     var expect = 'X';
     var actual = grid.Field[3, 3];
     Assert.AreEqual(expect, actual);
 }
コード例 #5
0
        public void GenerateGridMethodShouldBeReturnValidMatrixLength()
        {
            var grid = new Grid(7, 7);
            var player = new Player();
            var initializer = new Initializer();

            var actual = initializer.GenerateGrid(player, grid);
            var expextetHorizontalLength = 7;
            var expextetVerticalLength = 7;

            Assert.AreEqual(expextetHorizontalLength, actual.Field.GetLength(0));
            Assert.AreEqual(expextetVerticalLength, actual.Field.GetLength(1));
        }