Q:

Test class for deleting a record in a custom related list is not working

I am trying to test a method in my code where I delete a selected record, but any possible change I made in my test method is not working.
The method in my APEX class is this:
global List<Solicitud_de_contacto__c> getSolInfos() {

    integer limitPlusOne = PageSize + 1;

    solinfos = [Select id, Name, Nombre_de_candidato__r.Name, Correo_electr_nico__c, CreatedDate, Estado_de_alumno__c from Solicitud_de_contacto__c where Nombre_de_candidato__r.id = : accountId and Numero_de_Intenciones_estudio_Postgrado__c > 0 ORDER BY CreatedDate DESC, Id DESC LIMIT :limitPlusOne];

    return solinfos;
}

public void DeleteSolInfo()
{
    // if for any reason we are missing the reference 
    if (SelectedSolInfoId == null) {

        return;
    }

    // find the Sol Info record within the collection
    Solicitud_de_contacto__c tobeDeleted = null;
    for(Solicitud_de_contacto__c solinfo : solinfos)
        if (solinfo.Id == SelectedSolInfoId) {
            tobeDeleted = solinfo;
            break;
        }

        //if Sol Info record found delete it
        if (tobeDeleted != null) {
            Delete tobeDeleted;
        }

        //refresh the data
        LoadSolInfoData();
    }
}

So, I am trying to test the DeleteSolInfo() method this way:
@isTest static void DeleteSolInfoTest() {
    CreateAccount();
    CreatePostgrado();
    CreateSolInfo();
    CreateIntencionEstudios();

    RelatedListsPostgrado controller = new RelatedListsPostgrado();

    Test.startTest();
    controller.Pagesize=5;
    controller.getSolInfos();
    controller.DeleteSolInfo();
    controller.LoadSolInfoData();
    Test.stopTest();
}

It only covers the part:
 if (SelectedSolInfoId == null) {

     return;

I tried to cover the rest and made thousand changes, tested and the coverage stays the same always, so the rest is not being covered. The last change I made is what I am showing above.
I would really appreciate if someone could give me some tips or where do I have to amend my test class, so the test coverage goes up?.

A:

You require a value in SelectedSolInfoId, but never provide a value to your controller, preventing your test from running past a certain point. 
This is a common pattern used to pass data from a visualforce page via an actionFunction or other similar component. The value is passed from the page, to the controller, before the function is called, in effect, creating a parameter out of a controller variable. Without a page to provide this value, you are required to provide it yourself in the test. 
You would set the value of SelectedSolInfoId to any valid id to be used by your delete method. I would suggest creating a few records, then deleting each one, checking to make sure they were deleted using System.assert. 

The way you are talking about this class leads me to believe you did not write it yourself. If this is one of your first attempts at writing apex code, I would highly suggest trying some of the trailheads salesforce provides as a training method, before trying to cover someone else's classes, or write your own. 
I would also suggest reading other questions about test classes on this site, and to do some reading on proper assert usage before trying to design tests. 

