public void Ctor_ShouldInitWithCorrectXPos(int xPos)
        {
            //Arrange and Act
            var entity = new EntityOnTheBoard(0, xPos, 0);

            //Assert
            entity.XPos.Should().Be(xPos);
        }
        public void Ctor_ShouldInitWithCorrectYPos(int yPos)
        {
            //Arrange and Act
            var entity = new EntityOnTheBoard(0, 0, yPos);

            //Assert
            entity.YPos.Should().Be(yPos);
        }
        public void Ctor_ShouldInitWithCorrectId(int id)
        {
            //Arrange and Act
            var entity = new EntityOnTheBoard(id, 0, 0);

            //Assert
            entity.Id.Should().Be(id);
        }
        public void Ctor_ShouldInitEqualToEntityToClone()
        {
            //Arrange
            var entityToClone = new EntityOnTheBoard(1, 2, 3);

            //Act
            var cloned = new EntityOnTheBoard(entityToClone);

            //Assert
            cloned.Should().Be(entityToClone);
        }
        public void IsDirectlyAbove_WhenOtherHasDifferentIdAndIsNotAbove_ShouldReturnFalse()
        {
            //Arrange
            var entityOne   = new EntityOnTheBoard(0, 1, 0);
            var entityAbove = new EntityOnTheBoard(1, 2, 3);

            //Act
            var isAbove = entityAbove.IsDirectlyAbove(entityOne);

            //Assert
            isAbove.Should().BeFalse();
        }
        public void IsDirectlyAbove_WhenOtherHasSameId_ShouldReturnFalse()
        {
            //Arrange
            var sameId      = 0;
            var entityOne   = new EntityOnTheBoard(sameId, 1, 0);
            var entityAbove = new EntityOnTheBoard(sameId, 1, 1);

            //Act
            var isAbove = entityAbove.IsDirectlyAbove(entityOne);

            //Assert
            isAbove.Should().BeFalse();
        }
        public void IsDirectlyOnTheRightTo_WhenOtherHasSameId_ShouldReturnFalse()
        {
            //Arrange
            var sameId           = 0;
            var entityOne        = new EntityOnTheBoard(sameId, 1, 0);
            var entityOnTheRight = new EntityOnTheBoard(sameId, 2, 0);

            //Act
            var isOnTheRight = entityOnTheRight.IsDirectlyOnTheRightTo(entityOne);

            //Assert
            isOnTheRight.Should().BeFalse();
        }
 private bool Equals(EntityOnTheBoard other)
 {
     return(Id == other.Id && XPos == other.XPos && YPos == other.YPos);
 }
 public bool OccupiesSamePositionAs(EntityOnTheBoard other)
 {
     return(XPos == other.XPos && YPos == other.YPos);
 }
 public bool IsDirectlyOnTheLeftTo(EntityOnTheBoard other)
 {
     return(Id != other.Id && YPos == other.YPos && XPos == other.XPos - 1);
 }
 public bool IsDirectlyAbove(EntityOnTheBoard other)
 {
     return(Id != other.Id && XPos == other.XPos && YPos == other.YPos + 1);
 }
 public EntityOnTheBoard(EntityOnTheBoard entityToClone)
 {
     Id   = entityToClone.Id;
     XPos = entityToClone.XPos;
     YPos = entityToClone.YPos;
 }