-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: soql keywords cleanup (#32)
test: add page to view expected markup test code test: add sample soql file fix: remove unnecessary system interfaces
- Loading branch information
Showing
7 changed files
with
320 additions
and
218 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
!dist/**/* | ||
!package.json | ||
!src/**/* | ||
!test/**/* | ||
!test/**/* | ||
!assets/* |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Apex Markup Check</title> | ||
<meta charset="UTF-8" /> | ||
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.js"></script> | ||
<script charset="UTF-8" src="../dist/apex.min.js"></script> | ||
<link rel="stylesheet" href="./testcode.css" /> | ||
<!-- <link rel="stylesheet" href="../src/styles/monokai-sublime-apex.css" /> --> | ||
<link rel="stylesheet" href="vs.css" /> | ||
<script> | ||
hljs.debugMode(); | ||
hljs.highlightAll(); | ||
</script> | ||
<style> | ||
pre code { | ||
white-space: pre-wrap; | ||
font-size: 120%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<pre><code class="language-apex"> | ||
/** | ||
* @author John Smith | ||
*/ | ||
@IsTest(Seealldata=true) | ||
public with sharing class L2Char implements Database.batchable { | ||
public static final String ERROR = 0x0001; | ||
|
||
@InvocableMethod(label='my invocable') | ||
public static void moveTo( | ||
Integer x, | ||
Integer y, | ||
Integer z | ||
) { | ||
|
||
|
||
Account a = new Account(); | ||
a.Custom__c = 'stringvalue'; | ||
insert a; | ||
Boolean ai = (Boolean) false; | ||
System.debug('Should not be called'); | ||
if (1 > 5 && !Test.isRunningTest()) { // wtf!? | ||
Database.insert(myAccounts, false); | ||
} | ||
} | ||
|
||
@TestSetup | ||
private static void makeData(Boolean a){ | ||
Custom__c c = new Custom__c(); | ||
|
||
for(Account a : acctLis ){ | ||
ConnectApi.insert a; | ||
} | ||
} | ||
|
||
@isTest | ||
private static void testme(){ | ||
System.assert(true); | ||
} | ||
|
||
@testVisible | ||
private List<SelectOption> recordTypes { get; private set; } | ||
|
||
for(Account a : [SELECT Id FROM Account WHERE LastModifiedDate = LAST_N_DAYS:3]){ | ||
Assert.fail(); | ||
} | ||
} | ||
|
||
trigger CTrig on Custom__c (before insert){ | ||
System.debug('inserting a record'); | ||
upsert myRecord__c; | ||
} | ||
</code></pre> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[SELECT | ||
Account.Name, | ||
(SELECT FIELDS(ALL) FROM Account.Contacts LIMIT 200) | ||
FROM Account] | ||
|
||
[SELECT Id, FIELDS(ALL) FROM User LIMIT 200] | ||
[SELECT | ||
TYPEOF What | ||
WHEN Account THEN Phone | ||
ELSE Name | ||
END | ||
FROM Event | ||
WHERE CreatedById IN | ||
( | ||
SELECT CreatedById | ||
FROM Case | ||
)] | ||
[SELECT | ||
TYPEOF What | ||
WHEN Account THEN Id, LastModifiedDate | ||
WHEN Opportunity THEN Id | ||
END | ||
FROM Task] | ||
[SELECT | ||
TYPEOF What | ||
WHEN Account THEN Phone, NumberOfEmployees | ||
WHEN Opportunity THEN Amount, CloseDate | ||
ELSE Name, Email | ||
END | ||
FROM Event] | ||
[SELECT Id, (SELECT Id from OpportunityLineItems) | ||
FROM Opportunity | ||
WHERE Id IN | ||
( | ||
SELECT OpportunityId | ||
FROM OpportunityLineItem | ||
WHERE totalPrice > 10000 | ||
)] | ||
[SELECT Id FROM Account WHERE CreatedDate = NEXT_N_FISCAL_QUARTERS:6] | ||
[SELECT Id FROM Opportunity WHERE CloseDate = N_WEEKS_AGO:3] | ||
[SELECT Id FROM Account WHERE CreatedDate = YESTERDAY] | ||
[SELECT Id, MSP1__c from CustObj__c WHERE MSP1__c includes ('AAA;BBB','CCC')] | ||
[SELECT Id | ||
FROM Case | ||
WHERE Contact.LastName = null] | ||
[SELECT Title FROM Question WHERE LastReplyDate > 2005-10-08T01:02:03Z WITH DATA CATEGORY Geography__c AT (usa__c, uk__c)] | ||
[SELECT LeadSource, COUNT(Name) cnt | ||
FROM Lead | ||
GROUP BY ROLLUP(LeadSource)] | ||
[SELECT LeadSource, COUNT(Name) cnt | ||
FROM Lead | ||
GROUP BY ROLLUP(LeadSource)] | ||
[SELECT Name, MAX(Amount), MIN(Amount) min, SUM(Amount) | ||
FROM Opportunity | ||
GROUP BY Name] | ||
[SELECT LeadSource, Rating, | ||
GROUPING(LeadSource) grpLS, GROUPING(Rating) grpRating, | ||
COUNT(Name) cnt | ||
FROM Lead | ||
GROUP BY ROLLUP(LeadSource, Rating)] |
Oops, something went wrong.