I was just wondering how to test the operating functions in asp.net net mvc. Most of my dependencies are injected to my controllers, so there is no big argument in the methods of action, but for example there may be some conditional argument which I think is indispensable.
In the past there are written examinations for these action methods, have decided dependency and have tested the results. I have found that it is very brittle and to maintain a real knockout. 'Expect' and 'stub' methods are broken very easily everywhere but I do not see any other way of testing the controller functions.
I think some of these may be easy to test manually! Anyone have any suggestions? Maybe I'm missing something here?
thanks
imran
I do not think I I prepare a single test for a controller because my argument is elsewhere. As you say that the controller has the minimum code in them and any argument in them is so simple that it does not really fit the testing strategy.
I prefer to give my model completely, as well as any support codes such as DTL and data layers etc.
I think that I have noticed that some people mock their copylets, pass in the expected model and see the output as a result, but I am not, I feel that if I test a controller If I do, I only test post jobs to ensure that what is being given to my controller is that I am doing the test along with the model (security). But then I have security in many places of different levels.
But they all perform more tests than integration functional. Functional I am somewhere I said earlier.
Again, if it is worth writing, then it is worth investigating, is not it? I think you need to decide what the illusive bits are and how you want to test them.
Comments
Post a Comment