diff --git a/UserGuide.page-vue-render.js b/UserGuide.page-vue-render.js index a1748dad0ea..b6f73656902 100644 --- a/UserGuide.page-vue-render.js +++ b/UserGuide.page-vue-render.js @@ -119,6 +119,6 @@ with(this){return _c('h2',{attrs:{"id":"command-summary"}},[_v("Command summary" with(this){return _c('div',{staticClass:"table-responsive"},[_c('table',{staticClass:"markbind-table table table-bordered table-striped"},[_c('thead',[_c('tr',[_c('th',[_v("Action")]),_v(" "),_c('th',[_v("Format, Examples")])])]),_v(" "),_c('tbody',[_c('tr',[_c('td',[_c('strong',[_v("Add")])]),_v(" "),_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("add n/NAME c/COURSE e/EMAIL")]),_v(" "),_c('br'),_v(" e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("add n/Susan Tan c/CS1101S e/susantan@u.nus.edu")])])]),_v(" "),_c('tr',[_c('td',[_c('strong',[_v("Edit")])]),_v(" "),_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("edit INDEX [n/NAME] [c/COURSE] [e/EMAIL] [r/REMARK]")]),_v(" "),_c('br'),_v(" e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("edit 1 c/CS1101S e/susantan@u.nus.edu")])])]),_v(" "),_c('tr',[_c('td',[_c('strong',[_v("Delete")])]),_v(" "),_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("delete INDEX")]),_c('br'),_v(" e.g.,"),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("delete 2")])])]),_v(" "),_c('tr',[_c('td',[_c('strong',[_v("Tag")])]),_v(" "),_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("tag INDEX t/ [ENUM_TAG]")]),_c('br'),_v(" e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("tag 1 t/AVERAGE")])])]),_v(" "),_c('tr',[_c('td',[_c('strong',[_v("Remark")])]),_v(" "),_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("remark INDEX r/REMARK")]),_v(" "),_c('br'),_v(" e.g., "),_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("remark 2 r/needs more help")])])]),_v(" "),_c('tr',[_c('td',[_c('strong',[_v("Exit")])]),_v(" "),_c('td',[_c('code',{pre:true,attrs:{"class":"hljs inline no-lang"}},[_v("exit")])])])])])])} },function anonymous( ) { -with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("["),_c('span',[_c('strong',[_v("Powered by")])]),_v(" "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.1.0")]),_v(", generated on Mon, 16 Oct 2023, 16:03:21 GMT+8]")])])])} +with(this){return _c('footer',[_c('div',{staticClass:"text-center"},[_c('small',[_v("["),_c('span',[_c('strong',[_v("Powered by")])]),_v(" "),_c('img',{attrs:{"src":"https://markbind.org/favicon.ico","width":"30"}}),_v(" "),_c('a',{attrs:{"href":"https://markbind.org/"}},[_v("MarkBind 5.1.0")]),_v(", generated on Mon, 16 Oct 2023, 18:08:16 GMT+8]")])])])} }]; \ No newline at end of file diff --git a/tutorials/AddRemark.html b/tutorials/AddRemark.html index e01da95a4a3..69117d4304a 100644 --- a/tutorials/AddRemark.html +++ b/tutorials/AddRemark.html @@ -179,7 +179,7 @@ return String.format(message, personToEdit); }
Tests are crucial to ensuring that bugs don’t slip into the codebase unnoticed. This is especially true for large code bases where a change might lead to unintended behavior.
Let’s verify the correctness of our code by writing some tests!
Of course you can simply add the test cases manually, like you've been doing all along this tutorial. The result would be like the test cases in here. Alternatively, you can get the help of IntelliJ to generate the skeletons of the test cases, as explained in the next section.
The goal is to write effective and efficient tests to ensure that RemarkCommand#execute()
behaves as expected.
The convention for test names is methodName_testScenario_expectedResult
. An example would be
-execute_filteredList_success
.
Let’s create a test for RemarkCommand#execute()
to test that adding a remark works. On IntelliJ IDEA
you can bring up the context menu and choose to Go To
> Test
or use the appropriate keyboard shortcut.
Then, create a test for the execute
method.
Following convention, let’s change the name of the generated method to execute_addRemarkUnfilteredList_success
.
Let’s use the utility functions provided in CommandTestUtil
. The functions ensure that commands produce the expected CommandResult
and output the correct message. In this case, CommandTestUtil#assertCommandSuccess
is the best fit as we are testing that a RemarkCommand
will successfully add a Remark
.
You should end up with a test that looks something like this.
This concludes the tutorial for adding a new Command
to AddressBook.
execute_filteredList_success
. Let’s create a test for RemarkCommand#execute()
to test that adding a remark works. On IntelliJ IDEA
you can bring up the context menu and choose to Go To
> Test
or use the appropriate keyboard shortcut.
Then, create a test for the execute
method.
Following convention, let’s change the name of the generated method to execute_addRemarkUnfilteredList_success
.
Let’s use the utility functions provided in CommandTestUtil
. The functions ensure that commands produce the expected CommandResult
and output the correct message. In this case, CommandTestUtil#assertCommandSuccess
is the best fit as we are testing that a RemarkCommand
will successfully add a Remark
.
You should end up with a test that looks something like this.
This concludes the tutorial for adding a new Command
to AddressBook.