-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a7370a
commit d66632a
Showing
14 changed files
with
109 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
force-app/main/default/apexdeepdive/string deep dive/toLowerCase/ToLowerCaseTemplate.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public with sharing class ToLowerCaseTemplate { | ||
public List<String> standardizeEmails(List<String> emails) { | ||
return null; | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...n/default/classes/ToLowerCaseTemplate.cls → ...deep dive/toLowerCase/ToLowerCaseTest.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
36 changes: 0 additions & 36 deletions
36
force-app/main/default/apexdeepdive/string deep dive/toLowerCase/toLowerCase.cls
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
force-app/main/default/apexdeepdive/string deep dive/toUpperCase/ToUpperCaseSolution.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public with sharing class ToUpperCaseSolution { | ||
public String convertToUpperCase(String jobTitle) { | ||
String formattedJobTitle = jobTitle.toUpperCase(); | ||
return formattedJobTitle; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...p/main/default/apexdeepdive/string deep dive/toUpperCase/ToUpperCaseSolution.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>59.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
5 changes: 5 additions & 0 deletions
5
force-app/main/default/apexdeepdive/string deep dive/toUpperCase/ToUpperCaseTemplate.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public with sharing class ToUpperCaseTemplate { | ||
public String convertToUpperCase(String jobTitle) { | ||
return null; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...p/main/default/apexdeepdive/string deep dive/toUpperCase/ToUpperCaseTemplate.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>59.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
76 changes: 76 additions & 0 deletions
76
force-app/main/default/apexdeepdive/string deep dive/toUpperCase/ToUpperCaseTest.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
public with sharing class ToUpperCaseTest { | ||
public class TestException extends Exception { | ||
} | ||
public class TestResultException extends Exception { | ||
} | ||
|
||
public class TestResult { | ||
public TestResult(String o, String s, Boolean p, String m) { | ||
order = o; | ||
scenario = s; | ||
pass = p; | ||
message = m; | ||
} | ||
public String order; | ||
public String scenario; | ||
public Boolean pass; | ||
public String message; | ||
} | ||
|
||
public class Solution { | ||
ToLowerCaseSolution tlcs = new ToLowerCaseSolution(); | ||
|
||
TestResult[] execute() { | ||
TestResult[] results = new List<TestResult>{}; | ||
results.add(test1('1')); | ||
results.add(test2('2')); | ||
return results; | ||
} | ||
|
||
public TestResult test1(String testNum) { | ||
String input = 'Developer'; | ||
String solution = 'DEVELOPER'; | ||
String testDesc = input; | ||
|
||
String msg; | ||
|
||
try { | ||
String result = new ToUpperCaseSolution() | ||
.convertToUpperCase(input); | ||
|
||
if (result != solution) { | ||
msg = 'Expected ' + solution + ', received: ' + result; | ||
} | ||
return new TestResult(testNum, testDesc, msg == null, msg); | ||
} catch (Exception e) { | ||
return new TestResult(testNum, testDesc, false, e.getMessage()); | ||
} | ||
} | ||
|
||
public TestResult test2(String testNum) { | ||
String input = 'Software eng'; | ||
String solution = 'SOFTWARE ENG'; | ||
String testDesc = input; | ||
|
||
String msg; | ||
|
||
try { | ||
String result = new ToUpperCaseSolution() | ||
.convertToUpperCase(input); | ||
|
||
if (result != solution) { | ||
msg = 'Expected ' + solution + ', received: ' + result; | ||
} | ||
return new TestResult(testNum, testDesc, msg == null, msg); | ||
} catch (Exception e) { | ||
return new TestResult(testNum, testDesc, false, e.getMessage()); | ||
} | ||
} | ||
} | ||
|
||
public static void runTest() { | ||
Solution sol = new Solution(); | ||
TestResult[] testResult = sol.execute(); | ||
throw new TestResultException(JSON.serialize(testResult)); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...e-app/main/default/apexdeepdive/string deep dive/toUpperCase/ToUpperCaseTest.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>59.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
28 changes: 0 additions & 28 deletions
28
force-app/main/default/apexdeepdive/string deep dive/toUpperCase/toUpperCase.cls
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.