In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Problems encountered in unit testing:
1. AssertEquals (true, check.isSatisfied (data, "4", null, null)
2. Assert.assertTrue (check.isSatisfied (data, "4", null, null)
Both statements can be run correctly if the class under test has no logic errors, but if the class under test has logic errors or other problems, it cannot return true correctly:
1. The first sentence is a good hint.
"expected: but was:"
two。 But the second statement only gives AssertionFailedError:null
It is easy to misunderstand that there is a null value in the object of the written unit test case, but no null value is found; in fact, there is a problem with the tested class.
It is recommended to do a good job with the first statement for unit test, junit4 new assertThat method, you can also try to use.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.