How can I instantiate an asp.net codebehind class in a test harness?

I am working on a website written using asp.net WebForms. I would like two test cases to wrap around some more interesting routines. How can I create an instance of a class that comes from an .aspx file in my test project so that I can manipulate it in nUnit?


Edit: what I really want to do is check the utility methods and event methods that are in the code. I do not want to publish on the page and read the answer. I want unit test Methods, not a page.

+3
source share
2 answers

, - ASP.NET, - asp.net. NUnit dll NUnit.

Microsoft, asp.net: http://msdn.microsoft.com/en-us/library/ms404696(VS.80).aspx

+3

, :

YourPage page = new YourPage();

.

0

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


All Articles