Writing a unit test for a Stack class is straightforward.
可以很直观地写出对堆栈类的单元测试。
It doesn't make sense to have a stack that pushes but doesn't pop, so you test the methods together as part of the contract the stack exposes to its client.
拥有可以推动但不能弹出的堆栈没有任何意义,因此,您可以将这些方法作为堆栈暴露给其客户机的契约的一部分进行测试。
Rather than building the history stack directly into the photo gallery, we generated a simple page to test our class.
我们没有直接在相册应用程序中建立历史堆栈,而是用一个简单的页面测试这个类。
应用推荐