The Ensure class is analogous to JUnit or TestNG's Assert type; however, it adds a series of methods that facilitate a more readable API (this is often called literate programming).
Ensure 类类似于 JUnit 或 TestNG 的 Assert 类型;但是,它增加了一系列方法,提供了更具可读性的 API(这常被称作文学编程)。
Type into the member function Main a few lines of code to create an instance of Quad and then assert that when the object Area method is given a length of 3 and width of 2, it returns the value 6.
在主函数中输入下列几行代码,创建Quad实例,并通过Assert断言,当长宽各为3和2时,返回的结果应该是6。
应用推荐