-
Test Coverage for Pagereference method with if statement
I need your assistance to complete test coverage for the following code. How do I add the Pagereference method in my test class and cover the if condition, Thank you!
public Pagereference newPage() {
Id classRecordTypeId = Schema.SObjectType.class__c.getRecordTypeInfosByName().get('Staff').getRecordTypeId();
String url = 'https://ourcommunity.force.com/staffportal/List?id=' + classId;
if(classType == classRecordTypeId) {
url += '&type=Staff';
}
return new PageReference(url);
}
Log In to reply.
Popular Salesforce Blogs
Self Service - The key for Customer Satisfaction and Cost reduction
Self-service is the practice of serving oneself, classic example is the Automatic Teller Machines(ATMs) in the banking world, which revolutionized how people withdraw and deposit…
Salesforce Commerce Cloud To Join Hands With Facebook Dynamic Ads
This season makes it possible for brands to leverage Salesforce Commerce Cloud and Facebook in fresh ways to deliver product information and drive conversion on…
Salesforce Lead Conversion Rates: Benchmark vs Industry Reality
A low lead conversion rate isn't always a sales problem. In many Salesforce implementations, the real bottleneck lies in CRM configuration, automation, and data quality.…
Popular Salesforce Videos
TrailheaDX 2020 - How Salesforce Plans To Make Virtual TDX2020 Better
For Salesforce, taking TrailheaDX digital is about more than just keeping the event going, the company wants to make TDX a better, more inclusive, and…
What Are Top 5 Salesforce Career Entry Jobs?
Wondering what are Top 5 Salesforce career entry jobs? Join this useful group for Salesforce job & career info. https://tinyurl.com/TelegramIntelogik
Tracking Member Engagement with Scoring and Dashboards
More than half of organizations with a member engagement plan reported that it helped them increase: Membership renewals by 51%. Attendance at events and webinars…
Popular Salesforce Infographics
Salesforce Unveils Sales and Service Suites Aimed at Accelerating ROI for Businesses
Salesforce has recently unveiled fresh sets of product suites aimed at enhancing the sales and service teams' performance. By integrating top-notch solutions from the Customer…
Salesforce vs. MS Dynamics 365 - Which is Best For You?
Two of the most popular options are Salesforce and MS Dynamics 365. And while every business has different priorities, there are some features, like user…
Salesforce IoT Cloud System - Connect With Your Customers Proactively
The Salesforce IoT Cloud is a platform for storing and processing IoT data. It uses the Thunder engine for scalable, real-time event processing. Its collection…