c# - Why is Private Accessor deprecated? -


it used number 1 reason choose mstest others access , test private methods. private accessors deprecated in visual studio 2012. know why microsoft make such decision? because it's not practice test private methods?

also, if still need unit test private methods, how in vs 2012 , later versions?

according vs team article generation of private accessors... feature deprecated in 2010 following reasons:

  1. lack of resources , time: focus release has been improve experience manual testers, priority code generation , publicize features has been lowered. there have been other issues publicize functionality utilize have not been addressed.

  2. new features language teams: language teams have made modifications project types , languages, have been unable respond changes have made , have not been able work new features have introduced.

(more historical notes may found via following search: mstest why private accessors depricated site:blogs.msdn.com ).

for second part of question - should not need unit-test private methods. if feel need expose such methods testing - consider if marking internal , using "friend" (internalsvisibletoattribute) work case.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -