Title: Update code templates using AAA · Issue #145 · utPLSQL/utPLSQL-SQLDeveloper · GitHub
Open Graph Title: Update code templates using AAA · Issue #145 · utPLSQL/utPLSQL-SQLDeveloper
X Title: Update code templates using AAA · Issue #145 · utPLSQL/utPLSQL-SQLDeveloper
Description: The current code template for the PL/SQL package body looks like this (test_ is the default prefix): CREATE OR REPLACE PACKAGE BODY test_[package_name] IS -- -- test -- PROCEDURE [procedure_name] IS l_actual INTEGER := 0; l_expected INTE...
Open Graph Description: The current code template for the PL/SQL package body looks like this (test_ is the default prefix): CREATE OR REPLACE PACKAGE BODY test_[package_name] IS -- -- test -- PROCEDURE [procedure_name] I...
X Description: The current code template for the PL/SQL package body looks like this (test_ is the default prefix): CREATE OR REPLACE PACKAGE BODY test_[package_name] IS -- -- test -- PROCEDURE [procedure_name] I...
Opengraph URL: https://github.com/utPLSQL/utPLSQL-SQLDeveloper/issues/145
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update code templates using AAA","articleBody":"The current code template for the PL/SQL package body looks like this (`test_` is the default prefix):\r\n\r\n```sql\r\nCREATE OR REPLACE PACKAGE BODY test_[package_name] IS\r\n\r\n --\r\n -- test\r\n --\r\n PROCEDURE [procedure_name] IS\r\n l_actual INTEGER := 0;\r\n l_expected INTEGER := 1;\r\n BEGIN\r\n -- populate actual\r\n -- ...\r\n \r\n -- populate expected\r\n -- ...\r\n \r\n -- assert\r\n ut.expect(l_actual).to_equal(l_expected);\r\n END [procedure_name];\r\n\r\nEND test_[package_name];\r\n/\r\n```\r\n\r\nThe body is grouped into three steps. Firstly, populate actual. Secondly, populate expected. Thirdly, assert. \r\n\r\nInstead of these three steps the [Arrange-Act-Assert pattern](https://java-design-patterns.com/patterns/arrange-act-assert/) should be used. It's popular in Unit testing.\r\n\r\nThe new template should look like this:\r\n\r\n```sql\r\ncreate or replace package body test_[package_name] is\r\n\r\n --\r\n -- test\r\n --\r\n procedure [procedure_name] is\r\n l_actual integer := 0;\r\n l_expected integer := 1;\r\n begin\r\n -- arrange\r\n -- ...\r\n \r\n -- act\r\n -- ...\r\n \r\n -- assert\r\n ut.expect(l_actual).to_equal(l_expected);\r\n end [procedure_name];\r\n\r\nend test_[package_name];\r\n/\r\n```\r\n\r\nThe other template should be changed accordingly.","author":{"url":"https://github.com/PhilippSalvisberg","@type":"Person","name":"PhilippSalvisberg"},"datePublished":"2022-02-25T07:27:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/145/utPLSQL-SQLDeveloper/issues/145"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a2dd16ea-0382-9acc-c3ac-089905a13759 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9E3E:214CC9:E679D4:146032E:696A68C0 |
| html-safe-nonce | 9f549e16c055d9bfb5e3ffa64dfeac5f92bc8ca32aa50ef111229817fb4f0e4d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTNFOjIxNENDOTpFNjc5RDQ6MTQ2MDMyRTo2OTZBNjhDMCIsInZpc2l0b3JfaWQiOiIyMjY4MTc2NTQyOTMzMzQ2NDk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | cb6f6909b00fad5803f308863f27878cc6513099d1614714fa932c28c4084f8d |
| hovercard-subject-tag | issue:1150129893 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/utPLSQL/utPLSQL-SQLDeveloper/145/issue_layout |
| twitter:image | https://opengraph.githubassets.com/31687c0bcd7ff63328d4fc33013b2c608051668df69655c48b8ff4c48abb7812/utPLSQL/utPLSQL-SQLDeveloper/issues/145 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/31687c0bcd7ff63328d4fc33013b2c608051668df69655c48b8ff4c48abb7812/utPLSQL/utPLSQL-SQLDeveloper/issues/145 |
| og:image:alt | The current code template for the PL/SQL package body looks like this (test_ is the default prefix): CREATE OR REPLACE PACKAGE BODY test_[package_name] IS -- -- test -- PROCEDURE [procedure_name] I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PhilippSalvisberg |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6fea32d5b7276b841b7a803796d9715bc6cfb31ed549fdf9de2948ac25d12ba6 |
| turbo-cache-control | no-preview |
| go-import | github.com/utPLSQL/utPLSQL-SQLDeveloper git https://github.com/utPLSQL/utPLSQL-SQLDeveloper.git |
| octolytics-dimension-user_id | 15661281 |
| octolytics-dimension-user_login | utPLSQL |
| octolytics-dimension-repository_id | 111097428 |
| octolytics-dimension-repository_nwo | utPLSQL/utPLSQL-SQLDeveloper |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 111097428 |
| octolytics-dimension-repository_network_root_nwo | utPLSQL/utPLSQL-SQLDeveloper |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f2d9f6432a5a115ec709295ae70623f33bb80aee |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width