URLパラメータ付きのApex Pageをテスト
イシュー
- URLパラメータによって動作がかわる ApexPageをテストする方法を確認
参考
- Testing Custom Controllers and Controller Extensions
- Apexテストコード作成の落とし穴 | Salesforce Developers Japan Blog
- JP:An Introduction to Apex Code Test Methods - developer.force.com
- [SalesForce]テスト時にgetパラメータをセット - KayaMemo
テストクラスでのパラメータの渡し方
ApexPages.currentPage().getParameters().put('qp', 'yyyy');
PageReference pageRef = Page.samplePage; //パラメータをセット pageRef.getParameters().put('pId', '10'); Test.setCurrentPage(pageRef);