exam questions

Exam 70-486 All Questions

View all questions & answers for the 70-486 exam

Exam 70-486 topic 1 question 93 discussion

Actual exam question from Microsoft's 70-486
Question #: 93
Topic #: 1
[All 70-486 Questions]

DRAG DROP -
You are building an ASP.NET application for a purchasing system.
The application has a method named CalculateBalance in the Purchasing class.
You need to create a unit test for the CalculateBalance method.
Which five actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Step 1: Select the Purchasing Project and add a new Unit Test Project.
First we create a Unit Test Project within the current project.
Step 2:

You can turn an existing unit test into an ASP.NET unit test by configuring it, that is, by assigning values to certain of the test's custom attributes. You set these values in the code file that contains the unit test.
All unit tests require the [TestMethod] attribute.

Step 3: Build the solution -

Step 4: Run all tests -

Step 5: Debug the solution -
After you run a unit test, if you chose to edit the test run configuration when you ran the test, you can open the Code Coverage window to see what percentage of the methods in the code that you are testing were covered by your unit tests.
Incorrect:
Not:

You do not set up testing by creating copies of methods.
References:
https://msdn.microsoft.com/en-us/library/ms182526(v=vs.90).aspx

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hungry_ape9000
Highly Voted 5 years ago
FINAL ANSWER: Select the Purchasing project and add a new Unit Test project Create a reference to the Purchasing project in the Unit Test project Add the TestClass attribute to the test class Build the solution Run all tests
upvoted 10 times
...
Leodolz
Most Recent 4 years, 4 months ago
I know everyone is saying that the answer is wrong because the Debug step seems to be extra, but it makes sense to try to see the code coverage of the unit test that is displayed when debugging. Also that step of creating the reference and having a copy of the method does not seems to be right, if so, unit tests would need too many files for big projects
upvoted 2 times
...
MoSalah10
5 years, 3 months ago
Select, Create, Add, Build, Run As simple as that Note: create option is half wrong, you don't have to copy the methode to your test class.
upvoted 4 times
ifs
4 years, 4 months ago
why shouldn't running the tests come before the build?
upvoted 1 times
...
...
ex
5 years, 5 months ago
Select, Create, Add, Run, Debug
upvoted 3 times
jvb1993
5 years, 5 months ago
Don’t use the create step. Note that it includes creating a copy of the code to test. This means maintaining the code in 2 places later.
upvoted 8 times
...
reco40
5 years, 5 months ago
I think so
upvoted 2 times
...
yapi
5 years ago
Why Debug??
upvoted 1 times
mr_
4 years, 11 months ago
Yeah, exactly. There is no reason to always debug the solution in order to accomplish the task according to requirements (I mean just develop single unit test).
upvoted 2 times
...
...
founderDev
5 years, 3 months ago
Answer is wrong, Correct answer is: 1. Select the Purchasing project and add a new Unit test project 2. Create a reference to the Purchasing project in the unit test project. Then create a test class that has a copy of……. 3. Add the TestClass attribute to the test class and the….. 4. Build the solution 5. Run all tests https://msdn.microsoft.com/en-us/library/ms182532.aspx
upvoted 28 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago