类org.junit.jupiter.params.aggregator.AggregateWith源码实例Demo

下面列出了怎么用org.junit.jupiter.params.aggregator.AggregateWith的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: triplea   文件: RemoteActionCodeTest.java
@ParameterizedTest
@CsvFileSource(resources = "/required-op-codes.csv")
void verifyCorrectOpCode(
    final int opCode, @AggregateWith(MethodAggregator.class) final Method method) {
  final RemoteActionCode remoteActionCode = method.getAnnotation(RemoteActionCode.class);

  assertThat(
      "Expected @RemoteActionCode annotation to be present for " + method,
      remoteActionCode,
      is(notNullValue()));

  assertThat("Invalid value for " + method, remoteActionCode.value(), is(opCode));
}
 
源代码2 项目: tutorials   文件: PersonUnitTest.java
@ParameterizedTest
@CsvSource({"Isaac Newton,Isaac,,Newton", "Charles Robert Darwin,Charles,Robert,Darwin"})
void fullName_ShouldGenerateTheExpectedFullName(String expectedFullName,
                                                @AggregateWith(PersonAggregator.class) Person person) {

    assertEquals(expectedFullName, person.fullName());
}
 
 类所在包
 同包方法