Home / CSE MCQs / JUnit MCQs :: JUnit Running JUnit Tests from Maven

CSE MCQs :: JUnit MCQs

  1. What is the output of following set of code ?

    int a,b;
    a = (b = 10) + 5;
  2. A.
    b = 10, a = 5
    B.
    b = 15, a = 5
    C.
    a = 15, b = 10
    D.
    a = 10, b = 10

  3. 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();
     }

  4. A.
    1, 97
    B.
    65, 95
    C.
    65, 97
    D.
    97, 1

  5. _________ is a class to represent a null and to stop the chain of lookups.
  6. A.
    LocalPropertyStack
    B.
    ResolvePropertyMap
    C.
    NullReturn
    D.
    ParseProperties

  7. ___________ is the class to resolve properties in a map.
  8. A.
    LocalPropertyStack
    B.
    ResolvePropertyMap
    C.
    NullReturn
    D.
    ParseProperties

  9. The __________ package contains plugins that make it easier to write custom actions by scripting their behaviour with BeanShell.
  10. A.
    org.jmock.api
    B.
    org.jmock.lib.action
    C.
    org.jmock.lib.script
    D.
    org.jmock.lib.legacy

  11. ______________ method performs an action in response to an invocation.
  12. A.
    describeTo(Description description)
    B.
    invoke(Invocation invocation)
    C.
    perform(String script)
    D.
    where(String name, Object value)

  13. __________ is a naming scheme in which the implicit name for a mock object is the mocked type's name prepend with "mock.
  14. A.
    RetroNamingScheme
    B.
    CamelCaseNamingScheme
    C.
    JavaReflectionImposteriser
    D.
    LastWordNamingScheme

  15. ____________ is a TestCase that verifies postconditions after the test has run and before the fixture has been torn down.
  16. A.
    JUnit3ErrorTranslator
    B.
    JUnit3Mockery
    C.
    MockObjectTestCase
    D.
    VerifyingTestCase

  17. _____________ returns the next of a sequence of elements each time it is invoked.
  18. A.
    ActionSequence
    B.
    CustomAction
    C.
    DoAllAction
    D.
    ReturnValueAction

  19. _____________ performs multiple actions every time it is invoked.
  20. A.
    ActionSequence
    B.
    CustomAction
    C.
    DoAllAction
    D.
    ReturnValueAction