Case Study: 2
Scenario 2
Background
You are developing an online shopping web application.
Business Requirements
A user is not required to provide an email address. If a user enters an email address, it must be verified to be
a valid email address.
Information about the first product on the product page must fade out over time to encourage the user to
continue browsing the catalog. Administrators must be able to edit information about existing customers.
Administrators also must be able to specify a default product on the product page.
Technical Requirements
General:
The web store application is in a load-balanced web farm. The load balancer is not configured to useserver
affinity.
The web store application is an ASP.NET MVC application written in Visual Studio 2012.
Products:
The value of the productId property must always be greater than 0. The Products page for mobile devices
must display to mobile users. The Products page fordesktop devices must display to desktop users.
Storage:
The data must be stored in a serialized XML data format.
Serialized objects must be schema-independent.
Exception handling:
Exceptions originating from IIS must display a page with support contact information.
Some page links expire, and users who access these links encounter 404 errors. Exceptions must be
logged by using the WriteLog method of the Utility class.
Browser and device support:
The application must support image format conversions from .bmp to .jpeg for mobile devices.
The application must support image format conversions from .bmp to .png for desktop devices.
Application Structure
********************************************************************
You need to modify the application to meet the productId requirement. What should you do?

A.
Modify the RegisterGlobalFilters method of the Global.asax.es file as follows.
Contract.Assume<ArgumentException>(productId != 0);
B.
Modify the GetDealPrice method of ProductController as follows.
Contract.Requires<ArgumentException>(productId > 0);
C.
Modify the RegisterGlobalFilters method of the Global.asax.es file as follows.
Contract.Requires<ArgumentException>(productId > 0);
D.
Modify the GetDealPrice method of ProductController as follows.
Contract.Assume<ArgumentException>(productId > 0);
Why Not B?
Major other dumps provider suggest B…..
0
0
I Think it should be B, could not find anything regarding contracts being applied in the RegisterGlobalFilters method
0
0
Yes, the answer should be B as explained by Szzzzzzzzz. On some websites, people are suggesting for answer D but we are not talking about third party tool here.
0
0
Well, I take it back. One person got 1000/1000 and he says that answer should be D. Can anyone vouch for this?
0
0
I believe B is not valid code
0
0
It should be D. as requirement is asking to assume product id is never 0.
Contract.Assume is for this purpose.
0
0
Sorry, the syntax of contract.assume is wrong. we cant say argument is null with contract.assume. So perhaps B.
0
0
This link says B: http://www.testdumps.com/free-download-new-updated-microsoft-70-486-real-exam-questions-and-answers-11-20.html
0
0
I agree with B.
http://devproconnections.com/aspnet-mvc/code-contracts-and-controllers
0
0
Its B
0
0
https://msdn.microsoft.com/en-US/library/system.diagnostics.contracts.contract.requires(v=vs.110).aspx
https://msdn.microsoft.com/en-Us/library/system.diagnostics.contracts.contract.assume(v=vs.110).aspx
0
0
Read this about the difference:
http://stackoverflow.com/questions/4758460/code-contracts-assume-vs-requires
I think it’s B, cause the value must be grater than 0, that is a “precondition”.
If you use “Assume” you can see the result only on runtime.
0
0
Besides, part of that new 231Q 70-486 dumps FYI:
https://drive.google.com/open?id=0B-ob6L_QjGLpflNtUWtkNlk3ODJFY0pqOUhqVFEwc0lrd0QtamRxUHFLLUdWZEVDaGtlQWM
Best Regards!
0
0