Skip to content

Responsibilities of AssertionChain and AssertionScope

Dennis Doomen edited this page May 26, 2024 · 3 revisions
  • By default, every AssertionChain creates a single AssertionScope
  • Only when somebody used new AssertionScope() the scope is reused
  • In a chained assertion, only the initial single AssertionScope is used
  • AssertionChain
    • Tracks contextual data
    • Calculates the caller identifier (and include the name of the AssertionScope)
  • AssertionScope
    • Throws the failure exception (either immediately or upon disposal)
    • Can have a name (formerly known as context)
    • Needs to track reportable data (such as the equivalency configuration) because it should only be shown once