To test a Visualforce controller that works with specific records, you should insert the necessary test data in the test class. Then instantiate a PageReference for the Visualforce page, set the record id in the page parameters, and use System.currentPageReference().getParameters().put('id', recordId) to simulate navigating to the page with that record.References: Apex Developer Guide - Testing Custom Controllers and Controller Extensions