Esempio n. 1
0
        public void ShootingTacticsChangesFromSurroundingToLinegAfterSecondSquareIsHit()
        {
            int[]  shipLengths = new int[] { 1, 2, 3 };
            Gunner g           = new Gunner(6, 6, shipLengths);

            Assert.AreEqual(ShootingTactics.Random, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Hit);
            Assert.AreEqual(ShootingTactics.Surrounding, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Hit);
            Assert.AreEqual(ShootingTactics.Inline, g.ShootingTactics);
        }
Esempio n. 2
0
        public void ShootingTacticsChangesFromRandomToSurroundiungAfterFirstSquareIsHit()
        {
            int[]  shipLenghts = new int[] { 1, 2, 3 };
            Gunner g           = new Gunner(6, 6, shipLenghts);

            Assert.AreEqual(ShootingTactics.Random, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Hit);
            Assert.AreEqual(ShootingTactics.Surrounding, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Missed);
            Assert.AreEqual(ShootingTactics.Surrounding, g.ShootingTactics);
        }
Esempio n. 3
0
        public void ShootingTacticsChangesFromInlineToRandomgAfterShipIsSunk()
        {
            int[]  shipLenghts = new int[] { 1, 2, 3 };
            Gunner g           = new Gunner(6, 6, shipLenghts);

            Assert.AreEqual(ShootingTactics.Random, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Hit);
            Assert.AreEqual(ShootingTactics.Surrounding, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Hit);
            Assert.AreEqual(ShootingTactics.Inline, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Sunken);
            Assert.AreEqual(ShootingTactics.Random, g.ShootingTactics);
        }
Esempio n. 4
0
        public void InitiallyShootingTacticsIsRandomAsLongAsFirstSquareIsHit()
        {
            int[]  shipLenghts = new int[] { 1, 2, 3 };
            Gunner g           = new Gunner(6, 6, shipLenghts);

            Assert.AreEqual(ShootingTactics.Random, g.ShootingTactics);

            g.NextTarget();
            g.ProcessHitResult(HitResult.Missed);
            Assert.AreEqual(ShootingTactics.Random, g.ShootingTactics);
        }