Skip to content

Commit

Permalink
New Assert class methods snippets (#4)
Browse files Browse the repository at this point in the history
* Update apex-snippets.json (#3)

replaced System.assert with Assert methods
added snippet for debug with JSON.serializePretty

* Added message param for assert snippets

---------

Co-authored-by: Ravindra Singh <[email protected]>
Co-authored-by: Ajinkya Hingne <[email protected]>
  • Loading branch information
3 people authored Jun 15, 2024
1 parent f32592d commit 3652bb6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## Changelog
All notable changes to this project will be documented in this file.

### [1.3.0] - 2024-06-15
#### Updated
- Assert snippets to use new Assert class
- Assert snippets to include message parameter

### [1.2.1] - 2020-07-04
#### Fixed
- Incorrect snippets for test class and test method
Expand Down Expand Up @@ -29,4 +34,5 @@ All notable changes to this project will be documented in this file.
[1.1.0]: https://github.com/meajinkya/salesforce-snippets/releases/tag/v1.1.0
[1.1.1]: https://github.com/meajinkya/salesforce-snippets/releases/tag/v1.1.1
[1.2.0]: https://github.com/meajinkya/salesforce-snippets/releases/tag/v1.2.0
[1.2.1]: https://github.com/meajinkya/salesforce-snippets/releases/tag/v1.2.1
[1.2.1]: https://github.com/meajinkya/salesforce-snippets/releases/tag/v1.2.1
[1.3.0]: https://github.com/meajinkya/salesforce-snippets/releases/tag/v1.3.0
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "salesforce-snippets",
"displayName": "Salesforce Snippets",
"description": "Useful Salesforce snippets to speed up writing code for Salesforce platform",
"version": "1.2.1",
"version": "1.3.0",
"publisher": "ajinkya-hingne",
"engines": {
"vscode": "^1.31.0"
Expand Down Expand Up @@ -45,4 +45,4 @@
"url": "https://github.com/meajinkya/salesforce-snippets.git"
},
"license": "SEE LICENSE IN LICENSE.txt"
}
}
14 changes: 11 additions & 3 deletions snippets/apex-snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@
"description": "Print debug to log with a variable value"
},

"System debug with variable json pretty": {
"prefix": "debugvarpretty",
"body": [
"System.debug('$1' + JSON.serializePretty${2:variable});"
],
"description": "Print debug to log with a variable value"
},

"Test method" : {
"prefix": "testmethod",
"body": [
Expand All @@ -148,23 +156,23 @@
"Assert" : {
"prefix": "assert",
"body": [
"System.assert(${1:booleanExpression});"
"Assert.isTrue(${1:booleanExpression}, '${2:message}');"
],
"description": "Assert for single boolean expression"
},

"Assert Equals" : {
"prefix": "asserte",
"body": [
"System.assertEquals(${1:expectedValue}, ${2:actualValue});"
"Assert.areEqual(${1:expectedValue}, ${2:actualValue}, '${3:message}');"
],
"description": "Assert for comparing two values"
},

"Assert Not Equals" : {
"prefix": "assertne",
"body": [
"System.assertNotEquals(${1:expectedValue}, ${2:actualValue});"
"Assert.areNotEqual(${1:expectedValue}, ${2:actualValue}, '${3:message}');"
],
"description": "Assert for comparing two values negative"
},
Expand Down

0 comments on commit 3652bb6

Please sign in to comment.