课程: Complete Guide To Java Testing with JUnit 5 & Mockito
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Add a display name to your tests
课程: Complete Guide To Java Testing with JUnit 5 & Mockito
Add a display name to your tests
- [Instructor] JUnit 5 comes with many new annotations that can help us improve the clarity and quality of our tests. One of these annotations is display name. Display name allows you to specify custom display names for your test methods. In the past, this might have been done with an assertion message, but the assertion message is only displayed if the assertion fails. A display name is different because it's always shown, regardless of whether the test passes or fails. We can add one at the top of the method. Addition should return correct sum. This feature helps you provide more descriptive names to your tests, making your test reports easier to understand. It can serve as documentation for what each test is intended to check, which can be invaluable for future maintenance. Let's run it and see the display name. In the output, we can see our display name for the addition test. Sometimes you might not need a display name, because the test name is descriptive enough. In the case…
内容
-
-
-
-
-
-
-
(已锁定)
Add a display name to your tests1 分钟 30 秒
-
(已锁定)
Nested tests3 分钟 31 秒
-
(已锁定)
Timeout1 分钟 47 秒
-
(已锁定)
AssertTimeout2 分钟 31 秒
-
(已锁定)
AssertAll3 分钟 50 秒
-
(已锁定)
Message suppliers2 分钟 3 秒
-
(已锁定)
Assumptions API2 分钟 57 秒
-
(已锁定)
TempDir7 分钟 15 秒
-
(已锁定)
Migrate from JUnit 4 to JUnit 52 分钟 52 秒
-
(已锁定)
Challenge: Sorting algorithm validation55 秒
-
(已锁定)
Solution: Sorting algorithm validation6 分钟 47 秒
-
(已锁定)
-
-
-
-