Below is the code for my test class.
Opportunity opp = [select Deal_Type__c from opportunity where Id: = <some id>];
Case objCase = new Case();
objCase.standard_or_nonstandard__c = 'Yes';
if(objCase.standard_or_nonstandard__c = 'Yes'){ // this if is getting tested
opp.Deal_Type__c = 'Standard';
}
else{ // else part is getting skipped
opp.Deal_Type__c = 'Not Standard';
}
And only first if condition is getting tested and other is skipping which is why the code is not reaching 75% off code coverage.
the field standard_or_nonstandard__c is picklist having two values Yes & No.
And if the value if Yes, the deal type should be standard, and if No, the deal type is not standard.
Any suggestion on this?