Write effective Unit tests/ test Classes | DAY 6 PART 2

  Рет қаралды 40,824

Salesforce Apex Hours

Salesforce Apex Hours

Күн бұрын

Пікірлер: 52
@sharma93anks
@sharma93anks 3 жыл бұрын
thanks alot, all videos are so clear and everything covered😃🙏🏻
@apexhours
@apexhours 3 жыл бұрын
You're welcome 😊
@Manikantagadde
@Manikantagadde 3 жыл бұрын
@@apexhours where should I get your classes code?
@AnnaSzabo
@AnnaSzabo Жыл бұрын
This is so valuable! THANK YOU
@apexhours
@apexhours Жыл бұрын
Glad it was helpful!
@AnnaSzabo
@AnnaSzabo Жыл бұрын
@@apexhours just as ALL your videos. I cancelled Netflix, Discovery Plus, and even Disney subscribtios. All I watch is Apex Hours!
@mrbeast3473
@mrbeast3473 3 жыл бұрын
@salesforeceapexhours at 18:00,you have commented the casting ,yet the code is working fine, could you please tell me why did you cast it before
@lbbhajandhuns
@lbbhajandhuns 3 жыл бұрын
@Salesforce Apex Hours did you uploaded the code anywhere
@apexhours
@apexhours 3 жыл бұрын
We will try to post it soon. To much busy in my personal project work. Sorry about that.
@ponnaakhil3574
@ponnaakhil3574 2 жыл бұрын
@@apexhours did not uploaded code till now
@jagrelot
@jagrelot 4 жыл бұрын
Let’s say If I insert 200 Invoice records that each have 50 Line Items, It will exceed the 10000 limit for the number of rows. How would you test a scenario like this?
@heikokraemer2735
@heikokraemer2735 4 жыл бұрын
An other great video, thank you guys! I have actually a question on Test.loadData / Static Resource: Is there any way to load User & UserLogin that way? I have a class setting a status field on frozen or locked users … but I can't set IsFrozen or IsPasswordLocked for a generated user in the test class. So after watching your video I have exported such a test-setup with locked and frozen users & their UserLogin and uploaded it as a static resource. But I'm running into errors without explanation. Have tried for days now, changed file format multiple times - other objects just load fine. I'm getting the 100% code coverage now by using live data … store two inactive user in the org, one frozen, one locked, … and I change logic to search for inactive users instead of active while test is running. Is there a better way to do this?
@apexhours
@apexhours 4 жыл бұрын
No you can not insert UserLogin records.
@priyankasingh8453
@priyankasingh8453 Жыл бұрын
public with sharing class ApproveUpdate { @AuraEnabled public static void updatedrec(String ppaId) { try { // Perform the necessary operations to approve the claim record // Update the record status to "Approved" or perform any other required actions // You can add additional logic or queries here if needed // Example: Update the record PurchaserPlanAssn claimRecord = [SELECT Id, Status FROM PurchaserPlanAssn WHERE Id = :ppaId]; claimRecord.Status = 'Approved'; update claimRecord; } catch (Exception e) { throw new AuraHandledException('Error approving claim: ' + e.getMessage()); } } @AuraEnabled public static void rejectClaimRecord(String ppaId) { try { // Perform the necessary operations to reject the claim record // Update the record status to "Rejected" or perform any other required actions // You can add additional logic or queries here if needed // Example: Update the record PurchaserPlanAssn claimRecord = [SELECT Id, Status FROM PurchaserPlanAssn WHERE Id = :ppaId]; claimRecord.Status = 'Rejected'; update claimRecord; } catch (Exception e) { throw new AuraHandledException('Error rejecting claim: ' + e.getMessage()); } } } the catch part is no gettting covered
@chhavisinghal9042
@chhavisinghal9042 4 жыл бұрын
Sir, from where I can get the source code of TestDataFactory Class?
@apexhours
@apexhours 4 жыл бұрын
Check ApexHours.com blog post
@enlightenedviaenvisions
@enlightenedviaenvisions 4 жыл бұрын
@SalesforceApexHours and #Amit. I am new to Salesforce and writing my first Rest API. I have created it and its working good. I need to create a Test class. I want to understand very basic thing. how could I let me test class know for which Apex code I am creating test class means how I can establish the connection. second I have multiple SOQL in my API. How I can establish the connection between my test class and Apex so It understand code coverage written for which SOQL
@vickyvijay151
@vickyvijay151 4 жыл бұрын
When I assigned a particular permissions Set to user I want to update multi picklist value in Account while creating a new record. ???? Thanks advance!!
@heikokraemer2735
@heikokraemer2735 4 жыл бұрын
What record? Account created by the user with the permission set? You can query PermissionSetAssignment … so you could verify in a trigger if the context user has such assignment. developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_profile_permissions.htm developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_permissionsetassignment.htm
@apexhours
@apexhours 4 жыл бұрын
Thanks for your help
@ameensams
@ameensams 3 жыл бұрын
Is there a specific reason why this session is covered in classic?
@apexhours
@apexhours 3 жыл бұрын
No such reason.
@RVAraghav
@RVAraghav 4 жыл бұрын
What is the difference between data factory and test setup method?
@apexhours
@apexhours 4 жыл бұрын
salesforce.stackexchange.com/questions/233111/testsetup-vs-datafactory
@RVAraghav
@RVAraghav 4 жыл бұрын
@@apexhours Thanks
@adarshsingh-lb3ws
@adarshsingh-lb3ws 2 жыл бұрын
Sir please share the link of codes....the ApexHours site dont have the Codes only some theory parts...also those notes look incomplete for DAY 6 Lecture 1 and 2
@viewer1353
@viewer1353 4 жыл бұрын
Thank you 😃
@apexhours
@apexhours 4 жыл бұрын
We are glad you liked it
@sanjayagrawal7288
@sanjayagrawal7288 2 жыл бұрын
The video series is very helpful but this video and the 1st part of this video(Unit test) has been bit disappointing because the presenter had all the scripts ready and it becomes very difficult to understand what the existing code is and what he is trying to do. I suggest to have videos where the method class are written in the video and then test classes to test those classes. This will help people to understand what is being done from scratch.
@karanammaheedhar3595
@karanammaheedhar3595 3 жыл бұрын
How to achive the code coverage for try catch block can you please give me any example if you have.it will help me to understand.thank you for the vedio
@apexhours
@apexhours 3 жыл бұрын
I will publish one blog post soon
@sachinpradhan7519
@sachinpradhan7519 4 жыл бұрын
Hi Amit, please help me create a static resource .
@apexhours
@apexhours 4 жыл бұрын
That part is there on recording
@atozknowledgehub4488
@atozknowledgehub4488 3 жыл бұрын
thank you
@apexhours
@apexhours 3 жыл бұрын
You're welcome
@deepakgidwani9003
@deepakgidwani9003 Жыл бұрын
TestDataFactory Class is covered very fastly :(
@apexhours
@apexhours Жыл бұрын
Sorry about that, CHeck our post for more details www.apexhours.com/test-data-factory-in-salesforce/
@maheshd4566
@maheshd4566 2 жыл бұрын
Can someone plz provide the codes used in this video?
@apexhours
@apexhours 2 жыл бұрын
available on apex hours website
@ashishsinghrajput888
@ashishsinghrajput888 3 жыл бұрын
can you please provide this assignment solution so that we can verify and improve our code
@apexhours
@apexhours 3 жыл бұрын
sure we will publish soon
@prashantpatil6073
@prashantpatil6073 4 жыл бұрын
wnice sir,But while u teach any concept on console then u scroll up n down its hard to understand what exactly u r doing beacuse i am non coder background.
@apexhours
@apexhours 4 жыл бұрын
I can understand please pause the recording and see
@guptagopal
@guptagopal 4 жыл бұрын
Amazing
@apexhours
@apexhours 4 жыл бұрын
Thank you! Cheers!
@maheshd4566
@maheshd4566 2 жыл бұрын
Confusing
@apexhours
@apexhours 2 жыл бұрын
Sorry about that
Asynchronous Apex| Batch Apex & Schedulers | DAY 7
1:25:45
Salesforce Apex Hours
Рет қаралды 60 М.
Writing Test Classes in Salesforce
40:24
Salesforce Apex Hours
Рет қаралды 126 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 35 МЛН
When Rosé has a fake Fun Bot music box 😁
00:23
BigSchool
Рет қаралды 6 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Test Classes and Best Practices
31:26
Salesforce Apex Hours
Рет қаралды 2,2 М.
Asynchronous Apex using future method and Queueable Apex
30:03
Salesforce Apex Hours
Рет қаралды 30 М.
Playwright Visual Testing Best Practices, presented by Applitools
1:00:01
Applitools: AI-Powered End-to-End Testing Platform
Рет қаралды 468
Lightning web component Event Handling and Navigation : Day 13
1:23:42
Salesforce Apex Hours
Рет қаралды 40 М.
Introduction to Class, Method, Static and OOPs Concept in Apex | Day 2
1:22:30
Salesforce Apex Hours
Рет қаралды 208 М.
Basic of Triggers | DAY 5 Part 1
51:05
Salesforce Apex Hours
Рет қаралды 98 М.
Developer Tools & Debugging Tools | DAY 3
1:10:40
Salesforce Apex Hours
Рет қаралды 95 М.
Deep Drive in Test Classes | Apex Replay Debugger
1:36:37
Salesforce Apex Hours
Рет қаралды 20 М.
Basic of SOQL and SOSL in Salesforce | SOQL Crash Course | DAY 4 Part 1
1:17:40
Salesforce Apex Hours
Рет қаралды 115 М.
Introduction to Visualforce page
1:00:47
Salesforce Apex Hours
Рет қаралды 79 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39