Quantcast
Channel: March 2013 – Michael Freidgeim's Blog
Viewing all articles
Browse latest Browse all 3

Default Enum initialisation by MS Create Unit Tests wizard.

$
0
0
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

 


Viewing all articles
Browse latest Browse all 3

Trending Articles