- Which annotation in JUnit marks a test method?
View Answer
Correct answer: A — @Test
- In PyTest, test functions must start with:
View Answer
Correct answer: B — test_
- NUnit in C# uses which attribute for test methods?
View Answer
Correct answer: C — [Test]
- Which of the following is NOT a unit testing framework?
View Answer
Correct answer: D — Maven
- What is the purpose of assertions in unit testing?
View Answer
Correct answer: A — Validate expected results
- Which JUnit annotation runs before each test method?
View Answer
Correct answer: A — @Before
- Which JUnit annotation runs after each test method?
View Answer
Correct answer: A — @After
- In PyTest, fixtures are defined using:
View Answer
Correct answer: B — @pytest.fixture
- Which NUnit attribute runs once before all tests in a class?
View Answer
Correct answer: C — [OneTimeSetUp]
- Which of the following is true about unit tests?
View Answer
Correct answer: A — They test individual components
- What will be printed?
1 import org.junit.Test; 2 public class EduinqTest { 3 @Test 4 public void sample() { 5 System.out.println("Eduinq Unit Test"); 6 } 7 } View Answer
Correct answer: A — Eduinq Unit Test
- Which PyTest command runs all tests in a directory?
View Answer
Correct answer: A — pytest .
- NUnit tests are executed using:
View Answer
Correct answer: A — nunit-console
- Which JUnit assertion checks equality?
View Answer
Correct answer: A — assertEquals
- PyTest uses which keyword to mark expected exceptions?
View Answer
Correct answer: A — pytest.raises
- NUnit's [TearDown] attribute is used for:
View Answer
Correct answer: A — Cleanup after each test
- Which of the following is NOT an assertion in JUnit?
View Answer
Correct answer: D — assertRun
- PyTest supports parameterized tests using:
View Answer
Correct answer: A — @pytest.mark.parametrize
- NUnit supports ignoring tests using:
View Answer
Correct answer: A — [Ignore]
- Which of the following is true about unit testing frameworks?
View Answer
Correct answer: A — They provide automation support
- What will be printed?
1 def test_sample(): 2 print("Eduinq PyTest") View Answer
Correct answer: A — Eduinq PyTest
- JUnit tests can be grouped using:
View Answer
Correct answer: A — Test suites
- PyTest fixtures are useful for:
View Answer
Correct answer: A — Reusable setup/teardown
- NUnit supports parameterized tests using:
View Answer
Correct answer: A — [TestCase]
- Which JUnit annotation disables a test?
View Answer
Correct answer: A — @Ignore
- PyTest command to run a specific test file:
View Answer
Correct answer: A — pytest filename.py
- NUnit supports assertions like:
View Answer
Correct answer: A — Assert.AreEqual
- JUnit 5 introduced which annotation for test methods?
View Answer
Correct answer: A — @Test
- PyTest supports skipping tests using:
View Answer
Correct answer: A — @pytest.mark.skip
- NUnit supports expected exceptions using:
View Answer
Correct answer: A — Assert.Throws
- Which of the following is true about JUnit assertions?
View Answer
Correct answer: A — They validate test results
- PyTest supports fixtures with scope defined as:
View Answer
Correct answer: A — function, class, module, session
- NUnit supports setup methods using:
View Answer
Correct answer: A — [SetUp]
- JUnit supports running tests with:
View Answer
Correct answer: A — IDEs and build tools
- PyTest supports marking tests using:
View Answer
Correct answer: A — @pytest.mark
- NUnit supports categories using:
View Answer
Correct answer: A — [Category]
- Which JUnit annotation runs once before all tests?
View Answer
Correct answer: A — @BeforeClass
- PyTest supports custom markers defined in:
View Answer
Correct answer: A — pytest.ini
- NUnit supports teardown methods using:
View Answer
Correct answer: A — [TearDown]
- JUnit supports assertions like:
View Answer
Correct answer: A — assertTrue, assertFalse
- PyTest supports running tests in parallel using:
View Answer
Correct answer: A — pytest-xdist
- NUnit supports ignoring tests with reason using:
View Answer
Correct answer: A — [Ignore("reason")]
- JUnit supports exception testing using:
View Answer
Correct answer: A — assertThrows
- PyTest supports marking tests to run conditionally using:
View Answer
Correct answer: A — @pytest.mark.skipif
- In JUnit, which assertion checks if an object is null?
View Answer
Correct answer: A — assertNull
- NUnit supports running tests in parallel using:
View Answer
Correct answer: A — [Parallelizable]
- Which JUnit annotation runs once after all tests?
View Answer
Correct answer: A — @AfterClass
- PyTest supports marking tests as expected to fail using:
View Answer
Correct answer: A — @pytest.mark.xfail
- NUnit supports test case sources using:
View Answer
Correct answer: A — [TestCaseSource]
- Which of the following best describes unit testing?
View Answer
Correct answer: A — Testing individual components in isolation