All quizzes
Free quiz · 20 questions in the bank

xUnit quiz

Test your xUnit knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.

Question 1/5Score 0

What is `IClassFixture<T>` used for in xUnit, and what problem does it solve?

Questions in this quiz
  1. What is `IClassFixture<T>` used for in xUnit, and what problem does it solve?
  2. What is `Assert.Throws<T>()` used for in xUnit?
  3. What is `Assert.Collection()` used for in xUnit, and what advantage does it offer over manually checking a collection's count and then indexing into specific elements?
  4. How does the choice between `[Fact]` and `[Theory]` typically relate to test readability and maintenance, when a team has several closely related test scenarios differing only in specific input values?
  5. What does `Assert.Equal()` do in xUnit?
  6. What is a reasonable strategy for choosing between using a constructor (per-test setup) versus `IClassFixture<T>` (shared-across-class setup) for a given piece of setup logic in xUnit?
  7. What does `[InlineData]` provide when used with a `[Theory]` test method?
  8. What is the relationship between xUnit and a mocking library like Moq, given that xUnit itself doesn't provide mocking functionality?
  9. What is xUnit (xUnit.net)?
  10. What is `[MemberData]` used for as an alternative to `[InlineData]` in an xUnit `[Theory]` test?
  11. How do you run xUnit tests from the command line for a .NET project?
  12. What attribute marks a simple, parameterless test method in xUnit?
Gaps to close?
Read the curated xUnit notes — core concepts, patterns, interview prep.
xUnit notes

More quizzes

.NET.NET MAUIAbsintheAccessibilityActixActix Web