Each of these unit test methods takes an object of a specific class and a string (where the string is expected to be the name of the getter method that you are testing).
每个单元测试方法获取一个具体类的对象和一个字符串(字符串应该是您在测试的getter方法的名称)。
While this code is specific to a Printer, it is oblivious to whether the test is for printing or initialization, or to whether Printer is the target of a method call or a parameter to a method.
虽然这段代码是针对Printer的,但无论测试的是打印还是初始化,无论printer是方法调用的目标还是方法参数,都没有关系。
This test looks a little different, because the show method expects a specific person to show.
这个测试看起来和前面几个有些不同,因为show方法需要指明所要显示的person实例。
应用推荐