What should you do?

You are an enterprise application developer. You have created an ASP.NET application. You need to create a unit test to test the Button1_Click event handler of an aspx page by using the minimum amount of code.
What should you do?

You are an enterprise application developer. You have created an ASP.NET application. You need to create a unit test to test the Button1_Click event handler of an aspx page by using the minimum amount of code.
What should you do?

A.
Create a wrapper class to the page class in the App_Code folder.Create an ASP.NET unit test for the wrapper class.

B.
Change the scope of the Button1_Click event handler from visible to public.Create a wrapper class to the page class in another assembly.Create a unit test for the wrapper class.

C.
Get a reference to the Page object by calling the TestContext.RequestedPage property.Create a PrivateObject object by passing the Page object as a parameter.Use the Invoke method of the PrivateObject object to invoke the Button1_Click event handler.

D.
Get a reference to the Page object by calling the TestContext.RequestedPage property.Create a PrivateType object by passing the Page object as a parameter.Use the InvokeStatic method of the PrivateType object to invoke the Button1_Click event handler.



Leave a Reply 0

Your email address will not be published. Required fields are marked *