ict.ken.be

 

Mock framework vs manual mocking 

Categories: Testing

PRO

  • Fake implementations of abstractions.
  • Complete control over mock object functionality.
  • No need to learn frameworks.

CON

  • Each mock object adds more code.
  • As complexity grows, so do mock objects.
  • What if interface changes or interaction logic changes?
  • Total time needed to write all the mocks.

Principles of OOD 

Categories: Patterns

http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod

  • SRP - The Single Responsibility Principle : A class should have one, and only one, reason to change.
  • OCP - The Open Closed Principle : You should be able to extend a classes behavior, without modifying it.
  • LSP - The Liskov Substitution Principle : Derived classes must be substitutable for their base classes.
  • ISP - The Interface Segregation Principle : Make fine grained interfaces that are client specific.
  • DIP - The Dependency Inversion Principle : Depend on abstractions, not on concretions.

What's New in Resharper 7 

Categories: Visual Studio

by Dmitri Nesteruk

  • Quick Launch CTRL+Q integration
  • Windows Runtime Support (WinRT/Metro)
  • Code completion in Javascript, JSON, Html, ...
  • INotifyPropertyChanged Support eg. Microsoft.Practices.Prism.ViewModel (wpf)
  • Code Generation Improvements eg. Generate partial methods, IEqualityComparer<T>
  • Extract Class Refactoring
  • New Inspections and Quick-Fixes eg. await/async checks
  • Contract Annotations [ContractAnnotation("null => null")]
  • Multi-Level Context Actions and Quick-Fixes
  • Members Hierarchy CTRL-SHIFT-A
  • Unit Testing Improvements (Qunit, Jasmine, PhantomJS, NUnit - TestCaseSources)
  • Asp.NET 4.5/MVC 4
  • Sharepoint
  • LightSwitch
  • Improved naming
  • SDK language improvements

Resharper Shortcuts 

Categories: Notes Shortcuts

ReSharper Fundamentals

by James Kovacs

It wasn't the end of the world, but at least we got cheap licenses from JetBrains. Tx

Check their site for docs and videos.
Keep your hands on the keyboard.

Code Browsing

Navigate ALT-R,N
Find ALT-R,F
Navigate To ALT-µ

Goto Type CTRL-T use capital abbreviations
Goto File CTRL-SHIFT-T
Recent Files CTRL-, (VS edit.navigate.to)
Related Files CTRL-ALT-F7

Next Member ALT-UP
Previous Member ALT-DOWN
File Member CTRL-\
?? Containing Declaration CTRL-[

Goto Derived ALT-END
Goto Implementation CTRL-F12
Goto Base ALT-HOME
View Type Hierarchy CTRL-E,H
Goto Declaration F12
Goto Type of Symbol CTRL-SHIFT-F11

Find Usages SHIFT-F12
Highlight Usages ALT-SHIFT-F11 was Debug.StepInsideSpecific
Next Usage CTRL-ALT-PAGEUP
Previous Usage CTRL-ALT-PAGEDOWN
Advanced Find Usages CTRL-ALT-SHIFT-F12

Set/Remove Bookmark CTRL-SHIFT-[0-9]
Goto Bookmarks CTRL-[0-9]
View Bookmarks CTRL-µ

Goto Symbol ALT-SHIFT-T
Inspect This CTRL-ALT-SHIFT-A

Locate File ALT-SHIFT-L (VS team and diagram)

Code Cleanup

Quick Fix ALT-Enter
Next Highlight ALT-PAGEDOWN
Previous Highlight ALT-PAGEUP

Move Code Up/Down CTRL-ALT-SHIFT-UP/DOWN
Move Code In/Out CTRL-ALT-SHIFT-LEFT/RIGHT
Clipboard ring CTRL-SHIFT-V
View File Structure CTRL-ALT-F

Code Cleanup CTRL-E,C
Silent Code Cleanup CTRL-E,F
Resharper - Options - Code Editing - C# - Formatting Style - At end of line (K&R style)
Code Style Sharing - Per solution stored in a file.
You can select solution, project or folder and it will do cleanup everywhere.
Remove Unused Code ALT-ENTER
Safe Delete ALT-DEL

Refactoring

Refactor This CTRL-SHIFT-R
Extend Selection CTRL-ALT-RIGHT
Shrink Selection CTRL-ALT-LEFT
Rename CTRL-R,R

Introduce Variable CTRL-R,V
Introduce Field CTRL-R,F
Inline var/field CTRL-R,I

Extract Method CTRL-R,M
Inline Method CTRL-R,I
Introduce Parameter CTRL-R,P

Create New File CTRL-ALT-INSERT
Move Static Member CTRL-R,O
Move To Another File CTRL-R,O
Move To Folder CTRL-R,O
Move Type To Namespace CTRL-R,O
Static <> Extension CTRL-SHIFT-R
Method <> Property CTRL-SHIFT-R
Method <> Indexer CTRL-SHIFT-R
Encapsulate Field CTRL-SHIFT-R
Property <> Autoprop CTRL-SHIFT-R
Extract Superclass CTRL-SHIFT-R
Extract Interface CTRL-SHIFT-R
Pull Member Up/Down CTRL-SHIFT-R
Copy Type CTRL-SHIFT-R
Constructor to factory CTRL-SHIFT-R
Anonymous to Named CTRL-SHIFT-R
Interface <> AbstractClass CTRL-SHIFT-R
Use Base Type Where Possible CTRL-SHIFT-R
Extract Class from Parameters CTRL-SHIFT-R
Resource extraction CTRL-SHIFT-R
Code Editing - Localization - Uncheck don't analyse verbatim strings
Project - Properties - Localizable Yes - Inspector Pessimistic - [Localizable(false)]
Goto base ALT-HOME
Goto derived ALT-END
Change Signature CTRL-R,S

 Coding Assistance

Symbol Code Completion CTRL-SPACE
Smartcode Completion CTRL-ALT-SPACE
Import Symbol Completion ALT-SHIFT-SPACE

Coding Backwards CTRL-R,V
Complete Statements CTRL-SHIFT-ENTER
Duplicate Line/Selection CTRL-D
Comment/Uncomment Line CTRL-ALT-/
Comment/Uncomment Block CTRL-SHIFT-/
Surround With CTRL-E,U

Parameter Info CTRL-SHIFT-SPACE
Quick Docs CTRL-SHIFT-F1
Solution Wide Analysis Gray dot in right bottom corner

 Micro Code Generation & Templating

Generate Code ALT-INSERT
Implement delegating members
New file template - Resharper - Templates Explorer - File Templates
Insert Live Template CTRL-E,L
Create Live Template ALT-R,T,R
$END$, $PROP_TYPE$, $PROP_NAME$, $CLASS$, $SELSTART$, $SELEND$, $SELECTION$, ...
Users - User - AppData - Roaming - JetBrains - ReSharper - v7.1 - vs10.0 - UserSettings.xml

 Grab Bag of Useful Extras

Explore Stack Trace CTRL-E,T (copy stack message to clipboard first)
Todo-List CTRL-ALT-D

Run all tests ALT-R,U,N
Run test in context ALT-R,U,R
Run test in session ALT-R,U,C

Patterns Catalog
Download from JetBrains : Sample pattern catalog for Structural Search and Replace
ReSharper | Options | Code Inspection | Custom Patterns and click Import.

MSBuild and Nant helpers CTRL-ALT-F (only for .csproj)

Sticky Notes 

Categories: Windows

You know, those little post-it notes you can put on your desktop just to remember things. Well I was looking for them some time ago and it seems that it is horrible difficult to find this simple thingy. You can pay a lot of money for it or use one of the free version that are no good, like the sticky notes included with windows 7.

Anyway, we just did it ourselves. If you want the exe and code with a visual studio 2010 solution for free, just send us a message. Here was the sticky notes executable for windows 7 but since google thinks my website is malicious because of this I had to remove it. If one evening I have a bit of time I will move the project to my github.

If you want to do it yourself:

  • figure out how to keep the windows on desktop after show desktop command
  • figure out how to keep dragging, resizing and closing once there is no border
  • figure out how to save the data on the machine with limited permissions
  • figure out how to display your sticky notes on start-up
  • figure out how to drag the note from any place

It took us about two business days to build it.

Red pointer showing sticky notes.

Page 26 of 43 << < 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 40 > >>