Exemplo n.º 1
0
        public void TestFieldValuesOfShipLengthOne()
        {
            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_SINGLE
            },
                BimaruValues.FieldValuesOfShip(Direction.RIGHT, 1));

            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_SINGLE
            },
                BimaruValues.FieldValuesOfShip(Direction.LEFT, 1));

            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_SINGLE
            },
                BimaruValues.FieldValuesOfShip(Direction.UP, 1));

            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_SINGLE
            },
                BimaruValues.FieldValuesOfShip(Direction.DOWN, 1));
        }
Exemplo n.º 2
0
        public void TestFieldValuesOfShipLengthTwo()
        {
            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_CONT_RIGHT,
                BimaruValue.SHIP_CONT_LEFT
            },
                BimaruValues.FieldValuesOfShip(Direction.RIGHT, 2));

            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_CONT_LEFT,
                BimaruValue.SHIP_CONT_RIGHT
            },
                BimaruValues.FieldValuesOfShip(Direction.LEFT, 2));

            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_CONT_UP,
                BimaruValue.SHIP_CONT_DOWN
            },
                BimaruValues.FieldValuesOfShip(Direction.UP, 2));

            AssertEqualFieldValues(
                new List <BimaruValue>()
            {
                BimaruValue.SHIP_CONT_DOWN,
                BimaruValue.SHIP_CONT_UP
            },
                BimaruValues.FieldValuesOfShip(Direction.DOWN, 2));
        }
Exemplo n.º 3
0
 public void TestFieldValuesOfShipLengthZero()
 {
     Assert.ThrowsException <ArgumentOutOfRangeException>(
         () => BimaruValues.FieldValuesOfShip(Direction.RIGHT, 0).GetEnumerator().MoveNext());
 }