Thanks you pointed me in the right direction. Ultimately, this is what worked for me,
Test.setCurrentPage(pageRef);
ApexPages.CurrentPage().getparameters().put('id', cont[0].id)
The way you suggested gives this error " System.QueryException: List has no rows for assignment to SObject"