Thursday, January 30, 2014

TDD and Static Methods

Static methods present a problem in TDD. Interfaces do not support static methods. This can put a damper on fluent interfaces, unless the fluent interface is first developed in a TDD-ish manner and under test, then a fluent interface is put on top of the functionality.  This is usually how it is done anyway.

Especially in TDD avoid static methods unless you have a "good" reason to use them.  Trying to reduce two lines of code down to one for invoking a class, is not a good reason (in object oriented programming.)

Monday, January 20, 2014

NorfolkJs

The very first NorfolkJs meetup tonight. Great group, even had a pair of Google glasses starring at me.

Kevin had good suggestion, next time show filters on repeat.

Also note to self, if it has been a month since doing ng-class. .. brush up before presentation lol.

Presentation was on angularjs.

Went over data binding, controllers, ng-filter, ng-class, karma test runner, jasmine, testing, and a plug for egghead.io for training.

Sunday, January 19, 2014

TDD simple definition

Stating that TDD is just red, green, refactor, is like stating all you need to know to perform an appendectomy is make a cut and remove the appendix.

Monday, January 6, 2014

MOQ and out parameters

MOQ does not support out or ref parameters.  This bring up the debate about how testing tools can limit the developers creativity.  In the end testing is important.  There are other ways to accomplish the same goal.  The out parameter is nice but, testing is nicer.

public bool hasPermissions(string context, out List<string> allPermissions);

restructured to 
public bool hasPermissions(string context, List<string> allPermissions);

Not much of a change, but I do blow out all the data passed in.