This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ChildComponentController { | |
public String controllerValue; | |
public void setControllerValue (String s) { | |
controllerValue = s.toLowerCase(); | |
} | |
public String getControllerValue() { | |
return controllerValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:component controller="ChildComponentController"> | |
<apex:attribute name="componentValue" description="Attribute on the component." | |
type="String" required="required" assignTo="{!controllerValue}"/> | |
<apex:pageBlock title="My Child Custom Component"> | |
<p> | |
<code>componentValue</code> is "{!componentValue}" | |
<br/> | |
<code>controllerValue</code> is "{!controllerValue}" | |
</p> | |
</apex:pageBlock> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sfdx force:doc:commands:list | |
=== Commands | |
force:alias:list # list username aliases for sfdx | |
force:alias:set # set username aliases for sfdx | |
force:apex:class:create # create an apex class | |
force:apex:execute # execute anonymous apex code | |
force:apex:log:get # fetch a debug log | |
force:apex:log:list # list debug logs | |
force:apex:test:report # display test results | |
force:apex:test:run # invoke apex tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataLayerHandler { | |
public interface IDataLayer { | |
List<Document__c> getDocumentList(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataLayerHandler { | |
// DataLayer Class: | |
public class DataLayer implements IDataLayer { | |
List<Document__c> getDocumentList(){ | |
return [SELECT Id, Account__r.Business__c FROM Document__c]; | |
} | |
} | |
public interface IDataLayer { | |
List<Document__c> getDocumentList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DataLayerHandler { | |
// First, create the dataLayer variable: | |
private IDataLayer dataLayer; | |
// For an empty constructor, you create a new instance of the DataLayer: | |
public DataLayerHandler() { | |
this(new DataLayer()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
private class DataLayerHandler_Test { | |
private static MockDataLayer dataLayer; | |
public class MockDataLayer implements DataLayerHandler.IDataLayer { | |
List<Account> documentAccounts = new List<Account>(); | |
List<Document__c> mockDocuments = new List<Document__c>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isTest | |
private class DataLayerHandler_Test { | |
private static MockDataLayer dataLayer; | |
private static DataLayerHandler testedClass; | |
static { | |
dataLayer = new MockDataLayer(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String baseURL = 'https://' + System.URL.getSalesforceBaseUrl().getHost(); | |
string queryStr = 'SELECT+NumLinesCovered,ApexClassOrTriggerId,ApexClassOrTrigger.Name,NumLinesUncovered,Coverage+FROM+ApexCodeCoverageAggregate'; | |
String ENDPOINT = baseURL + '/services/data/v40.0/tooling/'; | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(ENDPOINT + 'query/?q=' + queryStr); | |
req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CodeCoverageWrapper { | |
public class ApexClassOrTrigger { | |
public Attributes attributes {get;set;} | |
public String Name {get;set;} | |
public ApexClassOrTrigger(JSONParser parser) { | |
while (parser.nextToken() != System.JSONToken.END_OBJECT) { | |
if (parser.getCurrentToken() == System.JSONToken.FIELD_NAME) { | |
String text = parser.getText(); |