Junit Mock Test IV
Junit Mock Test IV
This section presents you various set of Mock Tests related to JUnit Framework. You can
download these sample mock tests at your local machine and solve offline at your convenience.
Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Q 1 - @RunWith and @Suite annotation are used to run the suite test.
A - false
B - true
A - false
B - true
Q 3 - If a test class is annotated with @Ignore then none of its test methods will be
executed.
A - false
B - true
Q 4 - @Test annotation along with timeout attribute can be used to set timeout of a
test case.
A - false
B - true
Q 5 - @Test annotation along with expected attribute can be used to test the code
whether code throws desired exception or not.
A - true
B - false
Q 6 - Parameterized tests allow developer to run the same test over and over again
using same values.
A - true
B - false
A - true
B - false
A - true
B - false
A - true
B - false
A - true
B - false
Q 11 - Automated Test cases are executed by using automation tool so less tester are
required in automation testing.
A - true
B - false
A - true
B - false
A - true
B - false
Q 14 - JUnit provides Assertions for testing expected results.
A - true
B - false
A - true
B - false
Q 16 - JUnit tests can be run automatically and they check their own results and
provide immediate feedback.
A - true
B - false
Q 17 - Unit Tests are to be written before the code during development in order to
help coders write the best code.
A - true
B - false
Q 18 - Unit Tests are written after the code during development in order to help
coders test the code.
A - true
B - false
A - true
B - false
Q 20 - Fixture includes setUp method which runs before every test invocation.
A - true
B - false
Q 21 - Fixture includes setUp method which runs once when test class loads.
A - true
B - false
Q 22 - Fixture includes tearDown method which runs after every test method.
A - true
B - false
Q 23 - Fixture includes tearDown method which runs after all test methods get
executed.
A - true
B - false
A - true
B - false
Q 25 - TestCase contains a test case and defines the fixture to run multiple tests.
A - true
B - false
ANSWER SHEET
1 B
2 B
3 B
4 B
5 A
6 B
7 A
8 A
9 B
10 A
11 A
12 B
13 A
14 A
15 A
16 A
17 A
18 B
19 A
20 A
21 B
22 A
23 B
24 A
25 A
Loading [MathJax]/jax/output/HTML-CSS/jax.js