Exemple #1
0
        public void ShouldBeAwareOfRestricedDirections()
        {
            //Arrange
            var field  = new GreenField();
            var pirate = field.CurrentPirate;

            //   1 2
            // 5 p <---- так ходить нельзя
            //Act                                                 // 6s
            field.MovePirateTo(pirate, field.Cells(1, 5));        // 7
                                                                  // 8
            //Assert
            pirate.Position
            .ShouldBeEqual(new Position(0, 6));
        }
Exemple #2
0
        public void TestInit()
        {
            field = new GreenField(new TestEmptyRules(2), 1);
            field.GeneratePlayers(new TestEmptyRules(2));

            var player = field.CurrentPlayer;

            var teamBlack = player.CurrentTeam;

            teamRed = player.GetNextTeam();

            blackShip = teamBlack.Ship;
            blackShip.SetStrategy(Ship.ShipMovement.None);
            redShip = teamRed.Ship;
        }
        public void PirateCanMoveOnlyFromWaterToWater()
        {
            //Arrange
            var field  = new GreenField();
            var pirate = field.CurrentPirate;

            pirate.Position = new Position(0, 0);

            var waterCell = new WaterCell(1, 0);

            field.InsertCell(waterCell);

            //Act
            field.MovePirateTo(pirate, waterCell);

            //Assert
            pirate.Position.ShouldBeEqual(waterCell.Position);
        }
Exemple #4
0
        public void PathShouldContainCroco()
        {
            // Arrange
            var field = new GreenField();

            pirate = field.CurrentPirate;

            var startCell = field.Cells(3, 3);
            var crocoCell = new CrocoCell(4, 3);

            field.InsertCell(crocoCell);

            field.SetPirateOnCell(pirate, startCell);

            // Act
            field.MovePirateTo(pirate, crocoCell);

            // Assert
            pirate.Path.ShouldContain()
            .Elements(startCell.Position, crocoCell.Position, crocoCell.Position, startCell.Position);
        }
 public void TestInit()
 {
     field  = new GreenField();
     pirate = field.CurrentPirate;
 }
Exemple #6
0
 public void TestInit()
 {
     field = new GreenField();
 }