The state test of class is an important component part of object-oriented software test. Class unit test comes down to test the data member and member function.
类的状态测试是面向对象软件测试的重要内容,类的单元测试归结为测试类的数据成员和成员函数。
As long as the class being tested behaves as expected, it won't notice the difference, and the unit test can check that the proper query was emitted.
只要正在被测试的类的行为如所期望的那样,它将不会注意到差异,而单元测试会检查是否发出了正确的查询。
It also generates a special class that can be used to unit test the objects created.
它还生成一个特殊的类,这个类可用于对创建的对象进行单元测试。
The test class represents the usual unit of test execution that occurs while you are developing, and so we should consider carefully how many tests to include in any one class.
测试类表示在开发时发生的测试执行的常见单元,所以我们应仔细考虑任何一个类中包括了多少个测试。
As long as all the test cases pass, I add the new unit test class to my unit test automation library, which gets run on every build.
只要通过所有的测试用例,我就将向单元测试自动库添加新的单元测试类,在每次构建时运行。
You estimate a day to write each database access class and unit test it, so 150 tables at one table per day is 150 days.
估计您每天能编写一个数据库访问类并完成其单元测试,因此,150 个表要用 150天的时间。
The listing shows a utility class that gets used by the unit test.
这个清单给出单元测试使用的实用程序类。
Tests can be categorized according to the amount of code they exercise: a unit test verifies the functionality of a single software component, such as a function or a class.
可以将测试按照测试代码的多少分类:“单元测试”检验单一组件的功能,比如一个函数或者一个类。
Instead, I would write the class that runs all the unit test cases against the methods in the class.
相反,我编写根据类中的方法运行所有单元测试用例的类。
The next step is to run your unit tests, fix the syntax errors (that is, implement the class with the interfaces just defined by your test), and run the tests again.
下一步就是运行您的单元测试,修正语法错误(即,编写一个类,使它实现您的测试刚定义的接口),并再次运行测试。
As you can see, the unit test for a domain class now (with Grails 1.1) extends GrailsUnitTestCase.
可以看到,现在对一个域类的单元测试(在Grails 1.1中)扩展了GrailsUnitTestCase。
Unit tests are written from the developer's perspective and focus on particular methods of the class under test. Use these guidelines when writing unit tests
单元测试是从开发人员的角度出发编写的,并且关注的是所测试的类的特定方法。
For example, Listing 1 defines a unit test that USES JUnit to verify a stubbed out data class called BeerDaoStub.
例如,清单1定义了一个单元测试,该测试使用JUnit来验证一个叫做BeerDaoStub的存根数据类。
JsfTestCase: This is the base test class for unit tests for Servlet and JSF components in a web application.
AbstractJsfTestCase:这是对web应用的Servlet和JSF组件进行单元测试的基础测试类。
After the require statement, a class declaration stating that this class is a subclass of Test: : Unit: : TestCase must be added (as shown in below in Listing 6).
在require语句后面,添加一个类声明,指出这个类是Test: Unit:TestCase的子类(见清单6)。
To run this unit test, create a run configuration for the unit test class as a test: : unit type.
要运行这个单元测试,应该为单元测试类创建一个Test:Unit类型的Run配置。
To write the unit test for testing the View mode of the portlet in the BookmarkExampleTest class.
要编写单元测试在bookmarkexampletest类中测试portlet的View模式。
Listing 16: Base test class for Wicket unit tests of Warsaw and Global projects.
清单16:warsaw和Global项目的Wicket单元测试基类。
Not only is this easier to read, but it also helps with unit testing-we can unit test the action method without needing to mock the convenience properties of the controller class.
这不仅更易于阅读,而且它也有助于单元测试—我们不需要模仿控制器类的便利属性就能够单元测试这个动作方法。
Individual methods that are part of the mystringTest class form unit tests in the test suite.
mystringtest类中的方法形成测试套件中的单元测试。
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方法的名称)。
Generate test class for annotated-method interface for table: This will result in the generation of a special class that can be used for unit testing of the bean interface.
Generatetest classforannotated - methodinterface fortable:这将导致生成一个特殊的类,这个类可用于对bean接口进行单元测试。
Type grails test-app -unit User to target the specific test class you are interested in.
键入grailstest - app -unit User定位到您感兴趣的特定测试类。
If you write unit tests only using the Database unit test Designer, you might not be familiar with the concept of a test class.
如果您只使用数据库单元测试设计器来编写单元测试,则您可能不熟悉测试类的概念。
The earlier example assumes that the two unit tests are part of the same test class.
前面的示例假定两个单元测试属于同一测试类。
However, if your test run contains unit tests from different test classes, the common scripts for the associated test class will be run before and after the unit test runs.
但是,如果您的测试回合包含了不同测试类别的单元测试,则会在执行单元测试的前后,执行关联测试类别的通用指令码。
Class is the basic unit in object-oriented test. Generally, class test can be divided into the testing way based on data flow and the testing way based on object states.
类是面向对象测试的基本单元,类测试一般分为基于数据流的测试方法和基于对象状态的测试方法。
When you create a unit test, a separate unit test file is created for each class that you are testing.
注意事项当您产生单元测试时,系统预设建立的档案主要取决于测试专案设定。
You can refer to this class, for example, from a test method or a test-cleanup method that follows a unit test.
例如,可以从测试方法或从单元测试后使用的测试清理方法引用此类。
You can refer to this class, for example, from a test method or a test-cleanup method that follows a unit test.
例如,可以从测试方法或从单元测试后使用的测试清理方法引用此类。
应用推荐