Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified cunningBear/.sfdx/tools/apex.db
Binary file not shown.
15 changes: 15 additions & 0 deletions cunningBear/force-app/main/default/classes/AccountProcessor.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public class AccountProcessor
{
@future
public static void countContacts(Set<id> setId)
{
List<Account> lstAccount = [select id,Number_of_Contacts__c , (select id from contacts ) from account where id in :setId ];
for( Account acc : lstAccount )
{
List<Contact> lstCont = acc.contacts ;

acc.Number_of_Contacts__c = lstCont.size();
}
update lstAccount;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>47.0</apiVersion>
<status>Active</status>
</ApexClass>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@isTest
public class AccountProcessorTest {
@isTest
public static void TestAccountProcessorTest(){
Account a = new Account();
a.Name = 'Test Account';
Insert a;

Contact cont = New Contact();
cont.FirstName ='Bob';
cont.LastName ='Masters';
cont.AccountId = a.Id;
Insert cont;

set<Id> setAccId = new Set<ID>();
setAccId.add(a.id);

Test.startTest();
AccountProcessor.countContacts(setAccId);
Test.stopTest();

Account ACC = [select Number_of_Contacts__c from Account where id = :a.id LIMIT 1];
System.assertEquals ( Integer.valueOf(ACC.Number_of_Contacts__c) ,1);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>47.0</apiVersion>
<status>Active</status>
</ApexClass>
6 changes: 5 additions & 1 deletion cunningBear/force-app/main/default/lwc/jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"compilerOptions": {
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {}
"paths": {
"c/lW_comp": [
"lW_comp/lW_comp.js"
]
}
},
"include": [
"**/*",
Expand Down