How can I make an ASP.NET MVC site as a unit that can be tested as an ASP.NET Web Forms site?

also what day is today and why do I have an ugly unicorn as my avatar; -)

+3
source share
2 answers

First, you should use sealed classes and singleton everywhere - none of these wrapper classes with virtual methods that can be mocked or anything else. Then, and this is important, you should use Reponse.Write instead of returning. It also helps to serialize the contents of all form parameters, encrypt them and store them in hidden input on the page - then always check the new parameters for the old ones to see what things have changed. Using this method, you can create things called “events” - they look like button presses and are selected in Windows Forms. This is much easier to understand and simulate in your unit tests.

+6
source

You have a unicorn, because today is April Fools Day, and Jeff is a suction cup for this kind of thing.

wold , MVC , ASP.NET Forms. , , .

0

Source: https://habr.com/ru/post/1739537/


All Articles