Arrange-Act-Assert (AAA) هو نمط لهيكلة الاختبارات بوضوح إلى ثلاث مراحل: Arrange (الإعداد)، Act (تنفيذ الإجراء)، Assert (التحقق من النتيجة). يجعل الاختبارات قابلة للقراءة والتنظيم وسهلة الفهم.
المراحل الثلاث
ARRANGE → set up the test: create objects, prepare inputs, configure mocks, set state
ACT → perform the ACTION being tested (call the function/method under test)
ASSERT → verify the OUTCOME: check the result/behavior matches what's expected
→ A clear three-part structure for every test.
