Câu 22: 70-486: MCSD Developing ASP.NET MVC 4 Web Applications
HOTSPOT -You are building an ASP. NET application. You develop the following unit test code. Line numbers are included for reference only.01 [TestClass]02 public class UnitTest103 {04 protected string _name;05 protected float _expenses;06 protected float _income;07 protected float _payment;08 protected float _balance;…
Nội dung câu hỏi
HOTSPOT -You are building an ASP. NET application. You develop the following unit test code. Line numbers are included for reference only.01 [TestClass]02 public class UnitTest103 {04 protected string _name;05 protected float _expenses;06 protected float _income;07 protected float _payment;08 protected float _balance;09 public void AddCustomer(string name, float income, float payment, float balance)10 {11 _name = name;12 _expenses = expenses;13 _income = income;14 _payment = payment;15 _balance = balance;16 CheckName();17 DebRatio();18 CheckBalance();19 }20 [TestMethod]21 public void CheckName()22 {23 Assert.IsNotNull(_name, "CheckName failed unit test");24 }25 [TestMethod]26 public void DebRatio()27 {28 Assert.AreSame(_income, _payment, "DebRatio failed unit test");29 }30 [TestMethod]31 public void CheckBalance()32 {33 Assert.IsTrue(_balance >= 0.0f, Check balance failed unit test.");34 }35}You run the following line of code:AddCustomer("Contoso", 0, 100, 100, -1);You need to evaluate the unit test results. For each of the following statements, select Yes if the statement is true. Otherwise, select No. Hot Area:
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
-
A. Lựa chọn A bằng hình ảnh — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.