.net - Should I write unit tests for unimpemented methods? -
we have created interface our repository classes have common methods. there scenario new repository created not need implement method in interface.
in scenario, have written method in our repository class throw notimplementedexception
. worth writing unit tests method? if yes, better use expectedexception
attribute?
yes, should write test method, shouldn't take long if you're testing other methods in class.
writing test helps document conscious decision not implement method, not forgotten. acts reminder if in future comes along , implements method need write tests it.
as far expectedexception
attribute goes, it's subjective. use it, other people use time. should use whatever approach common within rest of tests checking exceptions.
Comments
Post a Comment