AssertJ JAVA 的流畅断言库开源项目

我要开发同款
匿名用户2015年09月25日
87阅读

技术信息

开源地址
https://github.com/joel-costigliola/assertj-core
授权协议
Apache

作品详情

AssertJ是 JAVA的流畅断言库。

示例代码:

// uique etry poit to get access to all assertThat methods ad utility methods (e.g. etry) import static org.assertj.core.api.Assertios.*; // commo assertios assertThat(frodo.getName()).isEqualTo("Frodo");assertThat(frodo).isNotEqualTo(sauro)                 .isI(fellowshipOfTheRig); // Strig specific assertios assertThat(frodo.getName()).startsWith("Fro")                           .edsWith("do")                           .isEqualToIgorigCase("frodo"); // collectio specific assertios assertThat(fellowshipOfTheRig).hasSize(9)                               .cotais(frodo, sam)                               .doesNotCotai(sauro); // usig extractig magical feature to check fellowshipOfTheRig characters ame :) assertThat(fellowshipOfTheRig).extractig("ame").cotais("Boromir", "Gadalf", "Frodo", "Legolas")                                                  .doesNotCotai("Sauro", "Elrod"); // map specific assertios, rigBearers iitialized with the elves rigs ad the oe rig bearers. assertThat(rigBearers).hasSize(4)                       .cotais(etry(oeRig, frodo), etry(eya, galadriel))                       .doesNotCotaiEtry(oeRig, aragor); // ad may more assertios : dates, file, umbers, exceptios ...

功能介绍

AssertJ 是 JAVA 的流畅断言库。 示例代码:
// unique entry point to get access to all assertThat methods and ...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论