Skip to content

Commit

Permalink
adding Apex test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
beAGoodQE committed Apr 27, 2024
1 parent c43a094 commit 8d19495
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,29 @@ public with sharing class LightningForgotPasswordControllerTest {
LightningForgotPasswordController controller = new LightningForgotPasswordController();
System.assertNotEquals(controller, null);
}
}

/* Verifies that null setExperienceId returns null. */
@IsTest
static void testLightningForgotPasswordControllerSetExperienceIdAsNull() {
System.assertEquals(LightningForgotPasswordController.setExperienceId(null), null);
}

/* Verifies setExperienceId Exception. */
@IsTest
static void testLightningForgotPasswordControllerSetExperienceIdException() {
System.assertNotEquals(LightningForgotPasswordController.setExperienceId('testText'), null);
}
}
/*
@IsTest
static void testSetExperienceId_Exception() {
// Test when an exception is thrown
String expId = 'yourInvalidExperienceId';
Test.startTest();
String errorMessage = YourClassName.setExperienceId(expId);
Test.stopTest();
// Assert that an error message is returned
System.assertNotEquals(null, errorMessage, 'Expected error message to not be null');
}
*/

0 comments on commit 8d19495

Please sign in to comment.