Purpose

Test the template set.

Tests

All tests must be executed in plugin deployed mode, instead of Development mode

  Purpose Context Operations Expected Result Results
2.1.1_1 Test the template import function In Silverlight perspective
  1. Call Window -> Preferences -> Silverlight-> C# Editor->Template>Import


  2. Selected a C# template file "msgbox.xml"(contains a template of MessageBox.Show())
The templates in template file are add into template list.
ok
2.1.1_2 Test the template export function In Silverlight perspective
  1. Open perspective "Window -> Preferences -> Silverlight-> C# Editor->Template"


  2. Select some templates, then click button "export"


  3. Enter template file name and saved location, click "save" button
The selected template are saved in the template file
ok
2.1.1_3 Test the "New Template" function In Silverlight perspective
  1. Open perspective "Window -> Preferences -> Silverlight-> C# Editor->Template"


  2. Click button "New"


  3. Enter The following parameters
    • Name: msgbox
    • Context: C# statements
    • Description: Generate an "MessageBox.Show()" Method
    • Pattern:
      MessageBox.Show(${word_selection}${});${cursor}
The "msgbox" template has added to the template list
ok
2.1.1_4 Test the "Edit Template" function In Silverlight perspective
  1. Open perspective "Window -> Preferences -> Silverlight-> C# Editor->Template"


  2. Select code template "msgbox"


  3. Click button "Edit"


  4. Modify the contents as following shows
    • Name: msg
    • Context: C# statements
    • Description: Generate an "MessageBox.Show("")" code
    • Pattern:
      MessageBox.Show("${word_selection}${}");${cursor}
The "msgbox" template has been modified correctly
ok
2.1.1_5 Test the "Remove Template" function In Silverlight perspective
  1. Open perspective "Window -> Preferences -> Silverlight-> C# Editor->Template"


  2. Select code template "msgbox"


  3. Click button "Remove"
The "msgbox" template has been removed
ok
2.1.1_6 Test the Code Template Auto Completion function In Silverlight perspective
  1. Create an Silverlight project, open an C# class file


  2. type one of the template, such as "msgbox", press Ctrl+Enter to invoke code auto completion
The following code was added automatic
MessageBox.Show("");
And the cursor position is in the end of current line
ok