© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•8mo ago•
8 replies
Faker

✅ How does the 3As pattern work in Unit Testing?

Hello, I'm getting started with xUnit for unit testing. I was reading a bit and I came across the 3A's pattern. We have
Arrange
Arrange
,
Act
Act
and
Assert
Assert
.

From what I've understood,
Arrange
Arrange
is how we get the data or how we declare it? For example, fetching data from a database but when we are testing we are going to expect some mockup so,
Arrange
Arrange
would mean creating that mockup?

Act
Act
is to perform the action that we are testing, for example if the method
Add_Two_Numbers
Add_Two_Numbers
add 2 numbers together.

Assert
Assert
is based on the value returned from the
Act
Act
, we compare the actual value and the expected value to see if the test is right or wrong?

Can someone confirm whether the above statements are correct pls, feel free to add up to it if needed.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

unit testing
C#CC# / help
2y ago
Unit testing
C#CC# / help
2y ago
✅ Unit testing
C#CC# / help
3y ago
Unit Testing in Minimal Apis
C#CC# / help
11mo ago