C# Mastery Hub
Home
Challenges
Discussion
Lessons
Core Topics
C# Fundamentals
Console Applications
Classes & OOP
Windows Forms
ASP.NET Core
SQL Server
VS & SQL Connection
RDLC Reports
.NET MAUI
Getting Started
Getting Started
Website Development
SEO Guide
Security
Project Workflow
Extra Topics
Cloud & Deployment
AWS Cloud
Deployment
About
Contact
Test Your Knowledge
Extra Topics - Lesson 2: Unit Testing with xUnit Quiz
Answer all questions to test your understanding
1
What is the purpose of unit testing?
To test the entire application
To verify individual code units behave correctly
To test the database
To test the user interface
2
What does the AAA pattern stand for in testing?
Arrange, Act, Assert
Action, Analyze, Assert
Arrange, Assert, Act
Act, Arrange, Assert
3
What is the difference between [Fact] and [Theory] in xUnit?
[Fact] is for single tests, [Theory] is for data-driven tests
[Theory] is for single tests, [Fact] is for data-driven tests
They are the same
[Fact] is for async tests only
4
Which command runs unit tests in .NET?
dotnet run tests
dotnet test
dotnet build tests
dotnet execute tests
5
What is the purpose of Assert in unit testing?
To arrange the test data
To verify the expected result
To execute the code
To setup the test
6
How do you test that a method throws an exception in xUnit?
Using try-catch
Using Assert.Throws
Using ExceptionAssert
Using throws keyword
Submit Quiz