PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which additional assertion should you test?

You create Microsoft Windows-based applications. You are designing a unit test class to test the functionality of a component named Calculator. The Calculator must function as a standard nonscientific calculator. A developer on your team writes the following lines of code for the test class. (Line numbers are included for reference only.)

01 [TestClass()]
02 public class CalculatorTest {
03 private TestContext testContextInstance;
04 public TestContext TestContext {
05 get{return testContextInstance;}
06 set{testContextInstance = value;}
07 }
08 [TestMethod()]
09 public void AddTest() {
10 Calculator target = new Calculator();
11 Assert.AreEqual(target.Add(1,1),2);
12 target.Dispose();
13 }
14 [TestMethod()]
15 public void SubtractTest() {
16 Calculator target = new Calculator();
17 Assert.AreEqual(target.Subtract(10,2),8);
18 target.Dispose();
19 }
20 }

You need to ensure that appropriate assertions are tested. Which additional assertion should you test?

What should you do?

You create Web-based client applications. You are creating a user-assistance
mechanism for a Web form. The Web form serves as a multilevel wizard for clients to set up a new inventory for items.

The user-assistance mechanism must meet the following requirements:

Enable entry-level users to understand every step of the multilevel wizard process. Ensure that users complete the multilevel wizard on their first try.

You need to select the appropriate user-assistance mechanism to meet the outlined requirements. What should you do?

Which code segment should you use?

You are creating a Virtual Earth 6.0 application.

A Web page of the application contains the following code segment.

control = document.createElement (“div”);
control.id = ” CustomControl “;

A custom control must be added on top of the map on the Web page.

You need to ensure that the custom control responds only to its own mouse-click events.
Which code segment should you use?

What should you do?

Your company uses an ASP.NET Web site. You create a Microsoft Office
InfoPath form named MyForm. You are creating a custom control that is derived from the
XMLFormView class. The custom control will display MyForm within an ASP.NET page on the Web
site. You need to ensure that MyForm can be displayed within an ASP.NET page on the Web site.

What should you do?

Which code segment should you insert at line 03?

You create a Microsoft Windows SharePoint Services application. A SharePoint site has a list named MyList. You write the following code segment. (Line numbers are included for reference only.)

01 Dim site As SPWeb = SPControl.GetContextWeb(context)
02 Dim list As SPList = site.Lists(“MyList”)
03 …

You need to bind the list to a DataGrid control. You also need to ensure that all the fields in the list are available in the DataTable object.

Which code segment should you insert at line 03?

Which lines of code should you add to your report?

You create Microsoft Windows-based applications. You are designing the integration test for an application. You write the following lines of code. (Line numbers are included for reference only.)

01 private void cmdCompare_Click(object sender, EventArgs e) { 02 decimal flightFare, carRental, hotelPrice, travelCost; 03 flightFare = wsFlyHigh.GetBestFare(txtOrigin.Text, txtDest.Text, datDateOut, datDateBack); 04 cmdGetRentalPrice.Parameters.Add(“@DAYS”,SqlDbType.Int); 05 cmdGetRentalPrice.Parameters[0].Value=int.Parse(txtDays.Text); 06 carRental = cmdGetRentalPrice.ExecuteScalar();
07 hotelPrice = bigDeal.GetHotelPrice(int.Parse(txtDays.Text)); 08 travelCost = flightFare + carRental + hotelPrice;
09 txtTravelCost.Text = travelCost.ToString(“C”);
10 }

You analyze the code and discover the following features:

wsFlyHigh is a Web service that is hosted on a partners extranet. cmdGetRentalPrice runs a stored procedure on a corporate database server.
bigDeal is a COM component.

You need to create a report that lists the parts of the code to be considered during integration testing.
Which lines of code should you add to your report?

What should you do?

You create Web-based client applications. You are creating an ASP.NET intranet site. The site permits individual departments to post content without involving the Central Information Technology resources. The site also permits Central Information Technology to maintain control over the intranet as a whole. Each department wants complete control over the appearance and behavior of their departmental content. However, Information Technology directives require every page on the intranet to maintain a consistent appearance and behavior. You need to develop the Web page on the intranet site so that it meets the requirements. What should you do?

Which code segment should you use?

You are creating a Virtual Earth 6.0 application to be viewed by using Microsoft Internet Explorer. The Web pages of the application contain maps.

The head section of the Web pages contains the following code fragment.

<script type=”text/javascript”>
var map = null;
function GetMap(){
map = new VEMap(‘Map’);
map.LoadMap();
ResizeMap();
}
</script> <style type=”text/css”>
html, body{ overflow:hidden; }
</style>

The body section of the Web pages contains the following code fragment.

<body onload=”GetMap();”>
<div id=’Map’ style=”position:relative; width:400px;
height:400px;”></div>
</body>
You need to resize the maps on the Web pages so that they exactly fit into the dimensions of the available browser area.

Which code segment should you use?