Example #1
0
        public void PlaceBoat_B3_C5_False()
        {
            SetupController setup = new SetupController(10);

            setup.Click(setup.grid.grid[1, 2]);
            setup.Click(setup.grid.grid[2, 4]);
            Assert.AreEqual(0, setup.boats.Count);
        }
Example #2
0
        public void PlaceBoat_B3_B5_True()
        {
            SetupController setup = new SetupController(10);

            setup.Click(setup.grid.grid[1, 2]);
            setup.Click(setup.grid.grid[1, 4]);
            Assert.AreEqual(1, setup.boats.Count);
            Boat boat = setup.boats[0];

            Assert.AreEqual(Direction.Down, boat.orientation);
            Assert.AreEqual(3, boat.cells.Count);
        }
        protected void CellClick(object sender, RoutedEventArgs e)
        {
            Button button = (Button)sender;

            int[] coord = (int[])button.Tag;
            controller.Click(controller.grid.grid[coord[0], coord[1]]);
        }