mocking - Testing aspx.cs classes? Should I do it? -
we using vs2010 4.0 framework ms test. question should create unit tests call aspx.cs page? using ef 4.0 , aspx.cs pages call down our repositories ( classes create / setup , remove objects context ). know need these tests but, should tests call aspx.cs pages or should separate calls repository file can tested self. i've never tried like:
mypage1 pg1 = new mypage1(); // test methods..
thanks
no.
testing aspx pages hard , horrible. sounds app highly coupled if need test views in manner. test repository in isolation, won't able test in view keep logic simple enough , should ok. in other words make pages invoke repository , return results.
alternatively check out adopting mvc paradigm.
Comments
Post a Comment