{"_id":"54d902d6c263bf2d003bb991","body":"## Docs are moving!\n\n[To ReadTheDocs](http://shouldly.readthedocs.org/en/latest)\n\nPlease help out! See the GitHub issue with what is left at https://github.com/shouldly/shouldly/issues/309","githubsync":"","hidden":false,"link_url":"","project":"54cb556861698d0d00baf7a2","title":"Overview","__v":2,"order":0,"sync_unique":"","updates":[],"createdAt":"2015-01-30T10:13:39.379Z","slug":"overview","user":"54c4ca1473b3db0d001a7571","version":"54d902d4c263bf2d003bb96a","api":{"auth":"required","params":[],"results":{"codes":[{"code":"{}","name":"","status":200,"language":"json"},{"status":400,"language":"json","code":"{}","name":""}]},"settings":"","url":""},"category":"54d902d5c263bf2d003bb96b","excerpt":"","link_external":false,"type":"basic","childrenPages":[]}

Overview

## Docs are moving!
[To ReadTheDocs](http://shouldly.readthedocs.org/en/latest)
Please help out! See the GitHub issue with what is left at https://github.com/shouldly/shouldly/issues/309

{"_id":"54d902d6c263bf2d003bb97e","githubsync":"","sync_unique":"","slug":"shouldsatisfyallconditions","version":"54d902d4c263bf2d003bb96a","__v":0,"project":"54cb556861698d0d00baf7a2","user":"54c4ca1473b3db0d001a7571","createdAt":"2015-02-04T18:07:31.766Z","title":"ShouldSatisfyAllConditions","link_external":false,"api":{"params":[],"url":"","results":{"codes":[{"language":"json","code":"{}","name":"","status":200},{"code":"{}","name":"","status":400,"language":"json"}]},"auth":"required"},"order":0,"excerpt":"It is a good practice to have only one assertion per test. But like they say 'To every rule, there is an exception'. Sometimes it might be neater to check for multiple things as part of a single test (null checking before asserting for example). Normally, if the first assertion fails, the test is terminated and the subsequent assertions are not evaluated. This might require multiple passes to fix each of the failing assertions. But by using the 'ShouldSatisfyAllConditions' method, all the assertions are evaluated at once and all failures displayed in one message, leading to quicker debugging.","category":"54d902d5c263bf2d003bb972","type":"basic","updates":[],"link_url":"","hidden":false,"body":"[block:code]\n{\n \"codes\": [\n {\n \"code\": \"[Test]\\npublic void ShouldSatisfyAllConditions()\\n{\\n var millionaire = new Person() { Name = \\\"Homer\\\", Salary = 30000 };\\n millionaire.ShouldSatisfyAllConditions\\n (\\n () => millionaire.Name.ShouldBe(\\\"Mr.Burns\\\"),\\n () => millionaire.Salary.ShouldBeGreaterThan(1000000)\\n );\\n}\",\n \"language\": \"csharp\"\n }\n ]\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Failure Message\",\n \"sidebar\": true\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"Shouldly.ChuckedAWobbly : \\n millionaire should satisfy all the conditions specified, but does not.\\n The following errors were found ...\\n--------------- Error 1 ---------------\\n\\n millionaire.Name\\n should be\\n \\\"Mr.Burns\\\"\\n but was\\n \\\"Homer\\\"\\n\\n--------------- Error 2 ---------------\\n\\n millionaire.Salary\\n should be greater than\\n 1000000\\n but was\\n 30000\\n\\n-----------------------------------------\",\n \"language\": \"text\"\n }\n ],\n \"sidebar\": true\n}\n[/block]","childrenPages":[]}

ShouldSatisfyAllConditions

It is a good practice to have only one assertion per test. But like they say 'To every rule, there is an exception'. Sometimes it might be neater to check for multiple things as part of a single test (null checking before asserting for example). Normally, if the first assertion fails, the test is terminated and the subsequent assertions are not evaluated. This might require multiple passes to fix each of the failing assertions. But by using the 'ShouldSatisfyAllConditions' method, all the assertions are evaluated at once and all failures displayed in one message, leading to quicker debugging.