Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development
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 on Saturday, March 16, 2013 1:00 PM | Back to top


Comments on this post: Default Enum initialisation by MS Create Unit Tests wizard.

# re: Default Enum initialisation by MS Create Unit Tests wizard.
Requesting 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!

Left by sharif on Mar 17, 2013 1:58 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net | Join free