Microsoft
70-355 · Question #38
You are developing a Universal Windows Platform (UWP) app. The app manipulates accounts by using a class named Account that you developed. You need to automate tests for the Debit method of the…
The correct code completion for the unit test is as follows: ``csharp [TestClass] public class UnitTest1 { [TestMethod] public void TestMethod1() { int expected = 1; int actual = Account.debit(1); Assert.AreEqual(expected, actual, 0.001, "Error Message"); } } ``
Debug and test
Question
You are developing a Universal Windows Platform (UWP) app. The app manipulates accounts by using a class named Account that you developed. You need to automate tests for the Debit method of the Account class. How should you complete the code? To answer, drag the appropriate code elements to the correct targets.
Explanation
The correct code completion for the unit test is as follows:
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
int expected = 1;
int actual = Account.debit(1);
Assert.AreEqual(expected, actual, 0.001, "Error Message");
}
}
Topics
#UWP#unit testing#MSTest#test automation
Community Discussion
No community discussion yet for this question.