Which unit test should you use?

You are developing an ASP.NET MVC web application that includes the following method.

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

You are developing an ASP.NET MVC web application that includes the following method.

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

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 6

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


steve

steve

Answer has to be C. currentGold was never declared in D.

fsays

fsays

It should be D, not C.
The point is about the attribute on top of the method, that should be [TestMethod]
The missing currentGold is a flaw in the code, I agree with you on that…

Steve

Steve

I think your right. ‘currentGold’ is never declared in D.
But ‘[UnitTest()] is wrong in C – so in my opinion the correct answer should be ‘B’.

Steve

Steve

Sorry. ‘IsEqual’ is not defined.
All aswers are wrong.
‘D’ would throw an exception because ‘totalGold’ is declared twice.

George

George

Yes, D is correct

Kishore

Kishore

Answer is D because there is no attribute [unittest()]