function assertIfBlockStructure(block, ifCount, hasElse) {
    assert.equal(block.type, 'controls_if');
    const inputs = block.inputList;
    assert.exists(inputs);
    const length = inputs.length;
    const expectedLength = hasElse ? ifCount * 2 + 1 : ifCount * 2;
    assert.equal(length, expectedLength);
    for (let i = 0; i < ifCount; i++) {
      assert.equal(inputs[i * 2].name, 'IF' + i);
      assert.equal(inputs[i * 2 + 1].name, 'DO' + i);
      if (i > 0) {
        assert.isNotNull(block.getField('MINUS' + i));
      }
    }
    if (hasElse) {
      assert.equal(inputs[length - 1].name, 'ELSE');
    }
  }
Asserts that the if block has the expected inputs and fields.
@param {!Blockly.Block} block The if block to check.
@param {number} ifCount The number of ifs we expect.
@param {boolean=} hasElse If we expect an else input.