Default Enum initialisation by MS Create Unit Tests wizard.

VS 2012 doesn’t show Create Unit Tests wizard. However it can be used – see

Where is the “Create Unit Tests” selection?  and

 
I’ve found the Wizard creates quite funny default for enumerator- to use constructor.
 
PaymentType paymentType = new PaymentType (); // TODO: Initialize to an appropriate value
 
I would prefer to have first/default enum value, e.g. 
 
PaymentType paymentType =PaymentType.None ;
 
I should suggest it to ALM Rangers, who started a new test generation project.
Another funny default is for numeric primitives:

 Decimal totalAmount = new Decimal(); // TODO: Initialize to an appropriate value

 

Advertisements