Contract Test

xiaoxiao2021-03-06  41

Diaspar Wrote In Contract Test: Contract Tests Explain How A Class Should A Superclass or Implement and Interface, So That I don't raster how to do what.

Always troubled with my questions about how to tell others to use the base class I wrote correctly, you can solve it through Contract Test:

Typically, a contract test case class is abstract, then I extend it and implement a creation method or two to return instances of my own implementation of the given interface. That gives me a standard battery of tests I can run to drive my implementation. It Might Not Be Perfect (I'll Have N Failing Tests To Start) But I Prefer It to Documentation Written In Pro.

.

Google, find a related blog: Design by Contract: Testing Implementations of Interfaces

转载请注明原文地址:https://www.9cbs.com/read-51199.html

New Post(0)