Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. __________ is a naming scheme in which the implicit name for a mock object is the mocked type's name prepend with "mock.
  1.    RetroNamingScheme
  2.    CamelCaseNamingScheme
  3.    JavaReflectionImposteriser
  4.    LastWordNamingScheme
 Discuss Question
Answer: Option A. -> RetroNamingScheme


The RetroNamingScheme class defines a naming scheme with the prefix of "mock for mock objects.


Question 2. ______________ method performs an action in response to an invocation.
  1.    describeTo(Description description)
  2.    invoke(Invocation invocation)
  3.    perform(String script)
  4.    where(String name, Object value)
 Discuss Question
Answer: Option B. -> invoke(Invocation invocation)


invoke(Invocation invocation) returns the result of the invocation, if not throwing an exception.


Question 3. ____________ is a TestCase that verifies postconditions after the test has run and before the fixture has been torn down.
  1.    JUnit3ErrorTranslator
  2.    JUnit3Mockery
  3.    MockObjectTestCase
  4.    VerifyingTestCase
 Discuss Question
Answer: Option A. -> JUnit3ErrorTranslator


VerifyingTestCase is a class that verifies post conditions.


Question 4. _____________ returns the next of a sequence of elements each time it is invoked.
  1.    ActionSequence
  2.    CustomAction
  3.    DoAllAction
  4.    ReturnValueAction
 Discuss Question
Answer: Option A. -> ActionSequence


The ActionSequence methods takes as a parameter the invocation to perform.


Question 5. _____________ performs multiple actions every time it is invoked.
  1.    ActionSequence
  2.    CustomAction
  3.    DoAllAction
  4.    ReturnValueAction
 Discuss Question
Answer: Option C. -> DoAllAction


The DoAllAction class implements the Action interface.


Question 6. What is the output of following set of code ?int a,b;a = (b = 10) + 5;
  1.    b = 10, a = 5
  2.    b = 15, a = 5
  3.    a = 15, b = 10
  4.    a = 10, b = 10
 Discuss Question
Answer: Option C. -> a = 15, b = 10


b is assigned 10 and after that its value is added with 5 and then saved in a, so a will be 15.


Question 7. The __________ package contains plugins that make it easier to write custom actions by scripting their behaviour with BeanShell.
  1.    org.jmock.api
  2.    org.jmock.lib.action
  3.    org.jmock.lib.script
  4.    org.jmock.lib.legacy
 Discuss Question
Answer: Option C. -> org.jmock.lib.script


org.jmock.lib.script is the package containing plugins to write custom actions by scripting.


Question 8. ___________ is the class to resolve properties in a map.
  1.    LocalPropertyStack
  2.    ResolvePropertyMap
  3.    NullReturn
  4.    ParseProperties
 Discuss Question
Answer: Option B. -> ResolvePropertyMap


The ResolvePropertyMap class is used to resolve properties in a map.


Question 9. What will be output of the following conversion ?static void Main(string[] args) {     char a = 'A';     string b = "a";     Console.WriteLine(Convert.ToInt32(a));     Console.WriteLine(Convert.ToInt32(Convert.Tochar(b)));     Console.ReadLine(); }
  1.    1, 97
  2.    65, 95
  3.    65, 97
  4.    97, 1
 Discuss Question
Answer: Option C. -> 65, 97


ASCII value of character 'a' is 65 and ASCII value of string "a is 97.
Output: 65,97


Question 10. _________ is a class to represent a null and to stop the chain of lookups.
  1.    LocalPropertyStack
  2.    ResolvePropertyMap
  3.    NullReturn
  4.    ParseProperties
 Discuss Question
Answer: Option C. -> NullReturn


The NullReturn class is the apache ant class representation of Null.


Latest Videos

Latest Test Papers