I am using Database.query to query Opportunity records in apex class.
list<Opportunity> opplist = Database.query('select Name,createdDate, Billing_Account__c,New_Type__c From Opportunity where id =: oppId');
We are creating an App for our clients production environment. And they all have the following fields already present in there production environment. If i will also create the following fields in my developer org then this will cause the duplicate because the client environment already has the fields and after installing the package there will 2 fields for the same purpose which is not a good practice. So that's why i am developing the dynamic query such that when i install the package my code refer to there production fields dynamically. I have written the dynamic query but not able to cover through test class.