Q:

How to pass record id from row to Test method?

I delete 1 record from table. How to pass into test method selectedMR(this record Id) and cover in test method from controller below?
VF PAGE:
<apex:repeat value={!mrItems} var="mrItem">
<apex:column>
            <apex:facet name="header">Deleting</apex:facet>
            <apex:commandButton value="Del" action="{!deleteMR}" reRender="form">
                <apex:param name="mritemId" value="{!mrItem.id}" assignTo="{!selectedMR}"/>
            </apex:commandButton>
        </apex:column>
</apex:repeat>

CONTROLLER
public void deleteMR() {
    if (selectedMR == null) {
        return;
    }

    TERF_MR__c tobeDeleted = null;
    for (TERF_MR__c mr : mrList)
        if (mr.Id == selectedMR) {
            if (mr.TERF_MR_Status__c != 'Approved') {
                tobeDeleted = mr;
                break;
            }
            else {
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.Info,'You can\'t delete approved month report'));
            }
        }

    if (tobeDeleted != null) {
        delete tobeDeleted;
        loadData();
    }

}

TEST
    static testMethod void test1() {
    test.startTest();
    TERF_MR__c MR = new TERF_MR__c();
    Insert MR ;
    System.assert([SELECT Name FROM TERF_MR__c WHERE Id = :MR.Id].Name != null);
    PageReference testpage = new pageReference('/apex/TERF_Home');
    testpage.getParameters().put('selectedMR', mr.Id);
    ApexPages.currentPage().getParameters().put('id', MR.id);
    TERF_Controller_Home contr = new TERF_Controller_Home();
    contr.gotoTERF_CreateNew();
    contr.deleteMR();
    contr.goToSystem();
    contr.save();
    test.stopTest();
}

A:

For your test, set it directly on the controller:
TERF_Controller_Home contr = new TERF_Controller_Home();
contr.selectedMR = mr.Id;
...
contr.deleteMR();

Not sure, but you can probably also do it by naming the parameter to match this:
<apex:param name="mritemId" value="{!mrItem.id}" assignTo="{!selectedMR}"/>

i.e.:
testpage.getParameters().put('mritemId', mr.Id);

