protected bool Equals(IGameField other) { return(Size == other.Size && other.EnumeratePositions() .All(position => this[position].Damaged == other[position].Damaged && this[position].GetType() == other[position].GetType())); }
public void ReturnCorrectValuesByIndex() { foreach (var position in field.EnumeratePositions()) { var cell = field[position]; var symbolInField = SampleField[position.Row][position.Column]; if (symbolInField == 'X') { cell.Should().BeAssignableTo <IShipCell>(); } else { cell.Should().BeAssignableTo <IEmptyCell>(); } cell.Damaged.Should().BeFalse(); } }