1

I heard that latest style is AAA. Is there any other one? Why we use one and don't use another?

Péter Török
  • 114,404
  • 31
  • 268
  • 329
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126

2 Answers2

1

The difference between the new AAA style and the old record/replay style is best understood by examining the difference between mocks and stubs. AAA uses stubs, while record/replay uses mocks.

I have blogged about the difference here.

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
0

I think there are 2 major styles - one is the classic one (not sure what is the name) - which existed from the beginning and the earliest versions of .Net (certainly I used it with .Net 1.1) and the AAA one. Both are still fully functional, so feel free to use any (but you can't mix them - it simply doesn't work and you will get weird errors).

The AAA style was developed after lambda expressions and extension methods were introduced in C# and many people (including me) think it is cleaner, easier to read and expresses the intent of the test better.

Grzenio
  • 35,875
  • 47
  • 158
  • 240