Microsoft 70-486 Exam Practice Questions (P. 2)
- Full Access (234 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #6
You are authoring unit tests.
The unit tests must test code that consumes sealed classes.
You need to create, maintain, and inject dependencies in the unit tests.
Which isolation method should you use?
The unit tests must test code that consumes sealed classes.
You need to create, maintain, and inject dependencies in the unit tests.
Which isolation method should you use?
- AT4 text templates and code generation
- BStub types
- CShim types
- DHard-coded implementation
Correct Answer:
C
Shim types are one of two technologies that the Microsoft Fakes Framework uses to let you easily isolate components under test from the environment. Shims divert calls to specific methods to code that you write as part of your test. Many methods return different results dependent on external conditions, but a shim is under the control of your test and can return consistent results at every call. This makes your tests much easier to write.
References:
http://msdn.microsoft.com/en-us/library/hh549176.aspx
C
Shim types are one of two technologies that the Microsoft Fakes Framework uses to let you easily isolate components under test from the environment. Shims divert calls to specific methods to code that you write as part of your test. Many methods return different results dependent on external conditions, but a shim is under the control of your test and can return consistent results at every call. This makes your tests much easier to write.
References:
http://msdn.microsoft.com/en-us/library/hh549176.aspx
send
light_mode
delete
Question #7
You are developing an ASP.NET MVC web application that includes the following method.

You need to test the AccountBalance method.
Which unit test should you use?


You need to test the AccountBalance method.
Which unit test should you use?

- AOption A
- BOption B
- COption C
- DOption D
Correct Answer:
C
All unit tests require the [TestMethod] attribute.
The Assert.AreEqual method verifies that specified values are equal.
Incorrect:
Not D: All unit tests require the [TestMethod] attribute.
References:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.assert.areequal(v=vs.110).aspx
C
All unit tests require the [TestMethod] attribute.
The Assert.AreEqual method verifies that specified values are equal.
Incorrect:
Not D: All unit tests require the [TestMethod] attribute.
References:
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.assert.areequal(v=vs.110).aspx
send
light_mode
delete
Question #8
You are developing an ASP.NET MVC application by using Visual Studio 2012.
The application throws and handles exceptions when it runs.
You need to examine the state of the application when exceptions are thrown.
What should you do?
The application throws and handles exceptions when it runs.
You need to examine the state of the application when exceptions are thrown.
What should you do?
- AFrom the Debug menu in Visual Studio 2012, select Exceptions. Enable the Thrown check box for Common Language Runtime Exceptions.
- BFrom the Debug menu in Visual Studio 2012, select Exceptions. Disable the User-unhandled check box for Common Language Runtime Exceptions.
- CAdd the following code to the web.config file of the application. <customErrors mode="On" > <error statusCode="500" redirect="CustomErrors.html" /> </customErrors>
- DAdd the following code to the web.config file of the application. <customErrors mode="On" > <error statusCode="404" redirect="CustomErrors.html" /> </customErrors>
Correct Answer:
A
Configuring the debugger to break for first chance exceptions
To change when the debugger breaks, go to Debug->Exceptions"¦

When you first open this window you will see that there is a tree grid with one column and checkboxes.
✑ Break when Thrown. This includes a default list of exceptions known by the debugger, grouped by category.
Note: The possible exceptions that could break from this list is determined by the runtime you are debugging. For example, if you are using managed-only debugging then the debugger will never break for C++, Win32 Exceptions, etc. even if they are configured to break when thrown.
✑ Checkboxes. If you check the box for a category, then the debugger will break for all First Chance Exceptions while debugging. If you don't want to enable all
First Chance Exceptions, you can find the specific exception types that you wish to configure by using the search box.
Reference: Understanding Exceptions while debugging with Visual Studio http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/08/understanding-exceptions-while-debugging-with-visual-studio.aspx
A
Configuring the debugger to break for first chance exceptions
To change when the debugger breaks, go to Debug->Exceptions"¦

When you first open this window you will see that there is a tree grid with one column and checkboxes.
✑ Break when Thrown. This includes a default list of exceptions known by the debugger, grouped by category.
Note: The possible exceptions that could break from this list is determined by the runtime you are debugging. For example, if you are using managed-only debugging then the debugger will never break for C++, Win32 Exceptions, etc. even if they are configured to break when thrown.
✑ Checkboxes. If you check the box for a category, then the debugger will break for all First Chance Exceptions while debugging. If you don't want to enable all
First Chance Exceptions, you can find the specific exception types that you wish to configure by using the search box.
Reference: Understanding Exceptions while debugging with Visual Studio http://blogs.msdn.com/b/visualstudioalm/archive/2015/01/08/understanding-exceptions-while-debugging-with-visual-studio.aspx
send
light_mode
delete
Question #9
You are developing an ASP.NET MVC news aggregation application that will be deployed to servers on multiple networks.
The application must be compatible with multiple browsers. A user can search the website for news articles. You must track the page number that the user is viewing in search results.
You need to program the location for storing state information about the user's search.
What should you do?
The application must be compatible with multiple browsers. A user can search the website for news articles. You must track the page number that the user is viewing in search results.
You need to program the location for storing state information about the user's search.
What should you do?
- AStore search results and page index in Session.
- BUse Application state to store search terms and page index.
- CUse QueryString to store search terms and page index.
- DStore search results and page index in TempData
Correct Answer:
C
C
send
light_mode
delete
Question #10
You are developing an ASP.NET MVC application. The application is deployed in a web farm and is accessed by many users.
The application must handle web server failures gracefully. The servers in the farm must share the state information.
You need to persist the application state during the session.
What should you implement?
The application must handle web server failures gracefully. The servers in the farm must share the state information.
You need to persist the application state during the session.
What should you implement?
- AA state server
- BCookieless sessions
- CA web garden on the web servers
- DAn InProc session
Correct Answer:
A
ASP.NET session state service provides a somewhat slower service than the in-process variant as we need to make calls to a remote server. All session data is stored in memory so shutting down the state machine will wipe out all session data as well.
Incorrect:
Not D: The InProc option is particularly dangerous in a web farm environment. For example imagine one farm machine which stores the session state but not the other. Subsequent web requests from the same user may not read the correct session state.
References:
https://dotnetcodr.com/2013/07/01/web-farms-in-net-and-iis-part-5-session-state-management/
A
ASP.NET session state service provides a somewhat slower service than the in-process variant as we need to make calls to a remote server. All session data is stored in memory so shutting down the state machine will wipe out all session data as well.
Incorrect:
Not D: The InProc option is particularly dangerous in a web farm environment. For example imagine one farm machine which stores the session state but not the other. Subsequent web requests from the same user may not read the correct session state.
References:
https://dotnetcodr.com/2013/07/01/web-farms-in-net-and-iis-part-5-session-state-management/
send
light_mode
delete
All Pages