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 t 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
 
posted @ Saturday, March 16, 2013 1:00 PM
Print

Comments on this entry:

# re: Default Enum initialisation by MS Create Unit Tests wizard.

Left by sharif at 3/17/2013 1:58 PM
Gravatar
The quality and content is great, and it is very quick and easy to follow along. I really look forward to seeing more. Thank you so much!

Your comment:



(not displayed)

 
 
 
 
 

Live Comment Preview:

 
«August»
SunMonTueWedThuFriSat
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456