Skip to content

Conversation

@github-classroom
Copy link
Contributor

@github-classroom github-classroom bot commented May 13, 2024

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to main since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to main since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to main. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @ManoolK

Copy link

@walters954 walters954 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent. I added some areas for practice. In your negative test cases try adding special characters as well.

Comment on lines +38 to +59
if (
ld.title.containsIgnoreCase('vp') ||
ld.title.containsIgnoreCase('v.p.') ||
ld.title.containsIgnoreCase('vice president')
) {
ld.Title = 'Vice President';
} else if (
ld.title.contains('mgr') ||
ld.title.contains('manage') ||
ld.title.contains('head of department')
ld.title.containsIgnoreCase('mgr') ||
ld.title.containsIgnoreCase('manage') ||
ld.title.containsIgnoreCase('head of department')
) {
ld.Title = 'Manager';
} else if (ld.title.contains('exec') || ld.title == 'chief' || ld.title.contains('head')) {
} else if (
ld.title.containsIgnoreCase('exec') ||
ld.title.containsIgnoreCase('chief') ||
ld.title.containsIgnoreCase('head')
) {
ld.Title = 'Executive';
} else if (ld.title.contains('assist') || ld.title.contains('deputy') || ld.title == 'jr') {
} else if (
ld.title.containsIgnoreCase('assist') ||
ld.title.containsIgnoreCase('deputy') ||
ld.title.containsIgnoreCase('jr')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all of these examples try create a contains the values that you are looking for then do contain on the list.

Comment on lines +82 to 84
if (ld.LeadSource == 'Web' && ld.Email != null) {
score += 3;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the condition values into a variable so it's easier to change in the future.

* @param name The name value for the Account
* @param doInsert Set true to insert new created records to the database
*/
public static Account getAccount(String name, Boolean doInsert) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this to generateAccount

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consistently, your method name would make this flow better. Overall this is really good.

* @param params The map that contains pairs of fieldName/value
* @param doInsert Set true to insert new created records to the database
*/
public static List<Lead> createLeadsWithParams(Integer numLeads, Map<String, Object> params, Boolean doInsert) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add additional test directly testing method like LeadTriggerHandler.handleTitleNormalization
Passing in the leads you create in memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants