nohwnd

Explore articles and content from this author

nohwnd

1 article published

6 min read

Command and query separation in Pester tests

Do you feel that writing tests is confusing, and you often end up with complicated test code? I did too, before I learned about Command-query separation principle (or CQS). This principle lead me to start thinking about data flow directions in tests and in the end I realized there are few basic patterns that I use in my test code over and over. Command-query separation principle The command and query separation principle tells us that we should separate commands from queries (duh!