Jakub Zalas<p>xUnit Test Patterns: Contract Test — <a href="https://zalas.pl/contract-test/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">zalas.pl/contract-test/</span><span class="invisible"></span></a></p><p>Contract Tests are examples that describe the behaviour of an abstraction by expressing what cannot be encoded in the type system. These are typically helpful in testing adapters as defined in the Ports & Adapters architecture.</p><p>Examples in <a href="https://mastodon.social/tags/kotlin" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>kotlin</span></a>, but the pattern is universal.</p><p><a href="https://mastodon.social/tags/contracttests" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>contracttests</span></a> <a href="https://mastodon.social/tags/xunit" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xunit</span></a> <a href="https://mastodon.social/tags/testing" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>testing</span></a> <a href="https://mastodon.social/tags/hexagonal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>hexagonal</span></a> <a href="https://mastodon.social/tags/portsandadapters" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>portsandadapters</span></a></p>