function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Major1507Major1507 

System.AssertException: Assertion Failed: Expected: false, Actual: true exception

Hi Everyone, below is my code and I;m getting this issue of - Assertion Failed: Expected: false, Actual: true
@IsTest(SeeAllData = true)
public with sharing class LightningLoginFormControllerTest {

 @IsTest
 static void LightningLoginFormControllerInstantiation() {
  LightningLoginFormController controller = new LightningLoginFormController();
  System.assertNotEquals(controller, null);
 }

 @IsTest
 static void testIsUsernamePasswordEnabled() {
  System.assertEquals(false, LightningLoginFormController.getIsUsernamePasswordEnabled());
 }

 @IsTest
 static void testIsSelfRegistrationEnabled() {
  System.assertEquals(false, LightningLoginFormController.getIsSelfRegistrationEnabled());
 }

 @IsTest
 static void testGetSelfRegistrationURL() {
  System.assertEquals(null, LightningLoginFormController.getSelfRegistrationUrl());
 }

 @IsTest
 static void testAuthConfig() {
  Auth.AuthConfiguration authConfig = LightningLoginFormController.getAuthConfig();
  System.assertNotEquals(null, authConfig);
 }
}

 
SwethaSwetha (Salesforce Developers) 
HI,
The line number throwing this exception has not been included in the question.Based on the code you've provided, it's difficult to determine which method is causing the issue. To get started,

> I see you are using SeeAllData=true which is not a recommended approach.

> Review the LightningLoginFormController class to ensure that it's functioning properly and returning the expected values. The failing assertion may be an indication of an issue with the class itself.

> Also, check the debug logs for more information about the failure. The logs may provide more insight into which assertion is failing and why.

If this information helps, please mark the answer as best. Thank you