Posts Tagged ‘code snippet’

Shortcuts for code snippets that I use everyday coding

I note down here to share my daily-used code snippets in Visual Studio 2010.
Each entry is applied by typing the snippet’s shortcut followed by `tab` key. Then, you can `tab` to navigate around the change-able values of the snippet.

  1. prop
    New property in short mode, i.e. { get; set;  }
  2. propfull
    New property in full mode
  3. for
    Insert simple for loop
  4. (More to be updated when available)



Code snippet to generate codes for a test class/method

Full details:

  1. Go to Edit – Intellisense – Insert code snippet
    or Ctrl – K – X
  2. Select Test
  3. Select Test Method/Test Class to insert the snippet for test class/method.
  4. Note: If hovering your mouse pointer on Test Method/Test Class you will get short-cut of the snippet in tool tips.

Get it quickly:
Start typing testc/testm and then tab twice to insert the snippet for test class/method.