SOQL-101 governor limit fires inside QuotationExtn.<init> before Test.startTest budget can help. Stack trace: hasAvailable → checkCarParkAvailablity → <init>. Affects every test that constructs QuotationExtn with a real fixture.

Diagnosis

QuotationExtn constructor calls checkCarParkAvailablity() which fires hasAvailable() 11 times — one SELECT COUNT() FROM Car_Parking_Charge__c per parking type — plus loadProjectAvailability() plus original initialization SOQL. Constructor alone consumes 30+ SOQL queries against the 100-SOQL governor limit. Test.startTest()/Test.stopTest() can only reset the counter once per test method; if the constructor itself exceeds 100, splitting fixture vs test phase doesn’t help. Modified by Amitabh Saasworx 29-Apr-2026 10:59 IST.

Fix

Bulkify the 11 hasAvailable() calls in QuotationExtn into one aggregate query: SELECT Parking__c, COUNT(Id) FROM Car_Parking_Charge__c WHERE Project__c = :proj.Id AND Category__c = ‘Additional’ AND Status__c IN (‘Vacant’) GROUP BY Parking__c. Map result to canAddCarPark1..11 booleans. Reduces 11 SOQL → 1 SOQL, freeing ~10 budget for the rest of the constructor + downstream methods.