public void ReturnTrue_ComparingWithSameXAndY()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2);
            var ship2 = new PatrolBoat(x: 1, y: 2);

            Assert.AreEqual(ship1, ship2);
        }
        public void ReturnTrue_ComparingWithDifferentDirectionsAndLength1()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2, directionInShip: Direction.Horizontal);
            var ship2 = new PatrolBoat(x: 1, y: 2, directionInShip: Direction.Vertical);

            Assert.AreEqual(ship1, ship2);
        }
        public void ReturnTrue_ComparingWithSameDirection()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2, directionInShip: Direction.Vertical);
            var ship2 = new PatrolBoat(x: 1, y: 2, directionInShip: Direction.Vertical);

            Assert.AreEqual(ship1, ship2);
        }
Example #4
0
        public void ReturnTrue_ComparingWithDifferentDirectionsAndLength1()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2, direction: Direction.Horizontal);
            var ship2 = new PatrolBoat(x: 1, y: 2, direction: Direction.Vertical);

            Assert.AreEqual(ship1, ship2);
        }
        public void ReturnFalse_ComparingWithDifferentLength()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2);
            var ship2 = new Cruiser(x: 1, y: 2);

            Assert.AreNotEqual(ship1, ship2);
        }
Example #6
0
        public void ReturnTrue_ComparingWithSameDirection()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2, direction: Direction.Vertical);
            var ship2 = new PatrolBoat(x: 1, y: 2, direction: Direction.Vertical);

            Assert.AreEqual(ship1, ship2);
        }
Example #7
0
        public void ReturnFalse_ComparingWithDifferentLength()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2);
            var ship2 = new Cruiser(x: 1, y: 2);

            Assert.AreNotEqual(ship1, ship2);
        }
Example #8
0
        public void ReturnTrue_ComparingWithSameXAndY()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2);
            var ship2 = new PatrolBoat(x: 1, y: 2);

            Assert.AreEqual(ship1, ship2);
        }
        public void ReturnFalse_ComparingDifferentXAndY()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2);
            var ship2 = new PatrolBoat(x: 2, y: 2);
            var ship3 = new PatrolBoat(x: 1, y: 1);

            Assert.AreNotEqual(ship1, ship2);
            Assert.AreNotEqual(ship1, ship3);
        }
Example #10
0
        public void ReturnFalse_ComparingDifferentXAndY()
        {
            var ship1 = new PatrolBoat(x: 1, y: 2);
            var ship2 = new PatrolBoat(x: 2, y: 2);
            var ship3 = new PatrolBoat(x: 1, y: 1);

            Assert.AreNotEqual(ship1, ship2);
            Assert.AreNotEqual(ship1, ship3);
        }
 protected bool Equals(PatrolBoat other)
 {
     return X == other.X && Y == other.Y;
 }