test class package should match the class under test

This commit is contained in:
金戟 2020-12-25 18:13:26 +08:00
parent 2d8433056c
commit 8d33cb718f
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ Compared with the class-granularity mocking practices of existing mock tools, `T
> - Mock non-constructive method, copy the original method definition to the test class, add a parameter of the same type as the caller, and add a `@MockMethod` annotation
> - Mock construction method, copy the original method definition to the test class, replace the return value with the constructed type, the method name is arbitrary, and add a `@MockContructor` annotation
> **Note**: There is also a convention in the current version that the name of the test class should be `<NameOfClassUnderTest> + Test`, which is usually the by-default naming convention of Java unit tests. This constraint may be relaxed or removed in future versions of `TestableMock`.
> **Note**: There is also a convention in the current version that the name of the test class should be `<NameOfClassUnderTest> + Test` (and in the same package path), which is usually the by-default naming convention of Java project managed by `Maven` or `Gradle`. This constraint may be relaxed or removed in future versions of `TestableMock`.
The detail mock method definition convention is as follows:

View File

@ -7,7 +7,7 @@
> - Mock非构造方法拷贝原方法定义到测试类增加一个与调用者类型相同的参数加`@MockMethod`注解
> - Mock构造方法拷贝原方法定义到测试类返回值换成构造的类型方法名随意加`@MockContructor`注解
> **注意**:当前版本还有一项约定是,测试类名称应该为`被测类名+Test`通常Java单元测试均符合这种惯例。此约定在未来的`TestableMock`版本中可能会被放宽或去除。
> **注意**:当前版本还有一项约定是,测试类与被测类的包路径应相同,且名称为`被测类名+Test`,通常采用`Maven`或`Gradle`构建的Java项目符合这种惯例。此约定在未来的`TestableMock`版本中可能会被放宽或去除。
具体的Mock方法定义约定如下